allow me to force update

This commit is contained in:
derpystuff 2022-06-20 21:33:18 +02:00
parent 987d1896ac
commit bc4dedb51f

View file

@ -10,8 +10,11 @@ module.exports = {
description: 'update bot', description: 'update bot',
examples: ['update'], examples: ['update'],
category: 'dev', category: 'dev',
usage: 'update' usage: 'update [-force true]'
}, },
args: [
{ default: false, name: "force", type: "bool" }
],
onBefore: context => context.user.isClientOwner, onBefore: context => context.user.isClientOwner,
onCancel: context => onCancel: context =>
context.reply( context.reply(
@ -22,7 +25,7 @@ module.exports = {
let response = await editOrReply(context, createEmbed("loading", context, "Updating bot...")) let response = await editOrReply(context, createEmbed("loading", context, "Updating bot..."))
try{ try{
const t = Date.now() const t = Date.now()
if(args.force) execSync("git checkout .")
const r = execSync("git pull") const r = execSync("git pull")
if(r.toString().includes("Already up to date.")) return await response.edit({embeds: [createEmbed("warning", context, "Already up to date.")]}) if(r.toString().includes("Already up to date.")) return await response.edit({embeds: [createEmbed("warning", context, "Already up to date.")]})