Send error event

This commit is contained in:
Jiiks 2019-03-07 14:15:24 +02:00
parent a57783a9d8
commit e5239d952e
1 changed files with 5 additions and 2 deletions

View File

@ -85,12 +85,12 @@ export default class Updater extends Module {
try {
console.log('[BetterDiscord:Updater] Updating', update.id);
await this.downloadTarGz(`https://github.com/JsSucks/BetterDiscordApp${update.remote}`, this.bd.config.getPath(update.id));
console.log('[BetterDiscord:Updater] Finished updating', update.id);
this.bd.sendToDiscord('updater-updateFinished', update);
this.updateFinished(update);
} catch (err) {
console.log('[BetterDiscord:Updater] Failed to update', update.id);
console.log(err);
update.error = err;
this.bd.sendToDiscord('updater-updateError', update);
}
}
@ -116,6 +116,9 @@ export default class Updater extends Module {
if (update.id === 'core') this.restartRequired = true;
if (update.id === 'client') this.reloadRequired = true;
console.log('[BetterDiscord:Updater] Finished updating', update.id);
this.bd.sendToDiscord('updater-updateFinished', update);
this.finishedUpdates++;
if (this.finishedUpdates >= this.totalUpdates) {
this.bd.sendToDiscord('updater-updated', { restartRequired: this.restartRequired, reloadRequired: this.reloadRequired });