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