From e8cfac48cc4248345ab56c1db5e6d0694041c494 Mon Sep 17 00:00:00 2001 From: Bsian Date: Mon, 4 May 2020 02:14:31 +0100 Subject: [PATCH] Add force update version --- src/commands/pull.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/pull.ts b/src/commands/pull.ts index 4cdcb3b..7639315 100644 --- a/src/commands/pull.ts +++ b/src/commands/pull.ts @@ -13,7 +13,7 @@ export default class Pull extends Command { this.permissions = { roles: ['662163685439045632'] }; } - public async run(message: Message) { + public async run(message: Message, args: string[]) { try { if (this.client.updating) return message.channel.createMessage(`${this.client.stores.emojis.error} ***Update in progress***`); this.client.updating = true; @@ -28,7 +28,7 @@ export default class Pull extends Command { this.client.updating = false; return updateMessage.edit(updatedMessage); } - if (pull.includes('Already up to date')) { + if (pull.includes('Already up to date') && args[0] !== '-f') { const updatedMessage = updateMessage.content.replace(`${this.client.stores.emojis.loading} ***Fetching latest commit...***`, `${this.client.stores.emojis.success} ***No updates available***`); this.client.updating = false; return updateMessage.edit(updatedMessage); @@ -38,7 +38,8 @@ export default class Pull extends Command { this.client.updating = false; return updateMessage.edit(updatedMessage); } - const continueMessage = updateMessage.content.replace(`${this.client.stores.emojis.loading} ***Fetching latest commit...***`, `${this.client.stores.emojis.success} ***Pulled latest commit***\n${this.client.stores.emojis.loading} ***Reinstalling dependencies...***`); + const continueMessage = updateMessage.content.replace(`${this.client.stores.emojis.loading} ***Fetching latest commit...***`, `${this.client.stores.emojis.success} ***${pull.includes('Already up to date') ? 'No updates available' : 'Fetched latest commit'}***\n` + + `${this.client.stores.emojis.loading} ***Reinstalling dependencies...***`); const passedPull = await updateMessage.edit(continueMessage);