Send error event
This commit is contained in:
parent
a57783a9d8
commit
e5239d952e
|
@ -85,12 +85,12 @@ export default class Updater extends Module {
|
||||||
try {
|
try {
|
||||||
console.log('[BetterDiscord:Updater] Updating', update.id);
|
console.log('[BetterDiscord:Updater] Updating', update.id);
|
||||||
await this.downloadTarGz(`https://github.com/JsSucks/BetterDiscordApp${update.remote}`, this.bd.config.getPath(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);
|
this.updateFinished(update);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log('[BetterDiscord:Updater] Failed to update', update.id);
|
console.log('[BetterDiscord:Updater] Failed to update', update.id);
|
||||||
console.log(err);
|
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 === 'core') this.restartRequired = true;
|
||||||
if (update.id === 'client') this.reloadRequired = true;
|
if (update.id === 'client') this.reloadRequired = true;
|
||||||
|
|
||||||
|
console.log('[BetterDiscord:Updater] Finished updating', update.id);
|
||||||
|
this.bd.sendToDiscord('updater-updateFinished', update);
|
||||||
|
|
||||||
this.finishedUpdates++;
|
this.finishedUpdates++;
|
||||||
if (this.finishedUpdates >= this.totalUpdates) {
|
if (this.finishedUpdates >= this.totalUpdates) {
|
||||||
this.bd.sendToDiscord('updater-updated', { restartRequired: this.restartRequired, reloadRequired: this.reloadRequired });
|
this.bd.sendToDiscord('updater-updated', { restartRequired: this.restartRequired, reloadRequired: this.reloadRequired });
|
||||||
|
|
Loading…
Reference in New Issue