From e4a64059e2bbc78b540775049105c339bb15729e Mon Sep 17 00:00:00 2001 From: zhiyu1998 Date: Wed, 15 Feb 2023 14:57:34 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20#R=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/update.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps/update.js b/apps/update.js index c0403d9..efe6763 100644 --- a/apps/update.js +++ b/apps/update.js @@ -23,7 +23,7 @@ export class update extends plugin { }, { /** 命令正则匹配 */ - reg: "^#*R(插件)?更新$", + reg: "^#*R(插件)?(强制更新|更新)$", /** 执行方法 */ fnc: "rconsoleUpdate", }, @@ -52,9 +52,17 @@ export class update extends plugin { await this.e.reply("您无权操作"); return true; } + + let isForce = !!this.e.msg.includes("强制"); + const pluginName = "rconsole-plugin"; - let command = `git -C ./plugins/${pluginName}/ pull --no-rebase`; + let command = ''; + if (isForce) { + command = `git -C ./plugins/${pluginName}/ pull --no-rebase` + } else { + command = `git checkout ./plugins/${pluginName}/ && git -C ./plugins/${pluginName}/ pull --no-rebase` + } this.oldCommitId = await this.getcommitId(pluginName); await e.reply("正在执行更新操作,请稍等");