diff options
Diffstat (limited to 'src/commands/dev')
-rw-r--r-- | src/commands/dev/reload.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/commands/dev/reload.ts b/src/commands/dev/reload.ts index 928632c..4898ad3 100644 --- a/src/commands/dev/reload.ts +++ b/src/commands/dev/reload.ts @@ -35,14 +35,16 @@ export default class ReloadCommand extends BushCommand { if (!message.author.isOwner()) return await message.util.reply(`${this.client.util.emojis.error} Only my developers can run this command.`); + let output: { stdout: string; stderr: string; }; try { const s = new Date(); - await this.client.util.shell(`yarn build-${fast ? 'esbuild' : 'tsc'}`); + output = await this.client.util.shell(`yarn build-${fast ? 'esbuild' : 'tsc'}`); this.client.commandHandler.reloadAll(); this.client.listenerHandler.reloadAll(); this.client.inhibitorHandler.reloadAll(); return message.util.send(`🔁 Successfully reloaded! (${new Date().getTime() - s.getTime()}ms)`); } catch (e) { + if (output) await this.client.logger.error('reloadCommand', output) return message.util.send( `An error occurred while reloading:\n${await this.client.util.codeblock(e?.stack || e, 2048 - 34, 'js')}` ); |