beta loading
This commit is contained in:
parent
d6825d9456
commit
9e70538497
|
@ -9,6 +9,9 @@ var _fs = require("fs");
|
|||
var _config = require("./config.json");
|
||||
var _utils = require("./utils");
|
||||
|
||||
//Use beta javascript
|
||||
var _beta = false;
|
||||
|
||||
var _ipc = require('ipc');
|
||||
|
||||
var _version;
|
||||
|
@ -74,7 +77,7 @@ BetterDiscord.prototype.init = function() {
|
|||
this.getUtils().log("Cache expired: " + _cacheExpired);
|
||||
|
||||
//Get latest commit hash
|
||||
this.getUtils().getHash(function(hash) {
|
||||
this.getUtils().getHash(_beta, function(hash) {
|
||||
_hash = hash;
|
||||
self.getUtils().log("Latest Hash: " + _hash);
|
||||
//Get updater
|
||||
|
|
|
@ -56,8 +56,9 @@ Utils.prototype.downloadHttp = function(url, callback) {
|
|||
});
|
||||
}
|
||||
|
||||
Utils.prototype.getHash = function(callback) {
|
||||
this.download("api.github.com", "/repos/Jiiks/BetterDiscordApp/commits/master", function(data) {
|
||||
Utils.prototype.getHash = function(beta, callback) {
|
||||
var branch = beta ? "beta" : "master";
|
||||
this.download("api.github.com", "/repos/Jiiks/BetterDiscordApp/commits/"+branch+"", function(data) {
|
||||
callback(JSON.parse(data).sha);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue