From 8086d645f9ccd8836dbe3c82beae2a5904feb61e Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Tue, 11 Apr 2023 17:50:09 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96update=E6=8C=87?= =?UTF-8?q?=E4=BB=A4=EF=BC=9A=E6=9B=B4=E6=96=B0=E6=88=90=E5=8A=9F=E5=90=8E?= =?UTF-8?q?=E4=B8=8D=E6=89=A7=E8=A1=8C=E9=87=8D=E5=90=AF=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=EF=BC=8C=E9=9C=80=E8=A6=81=E4=BD=BF=E7=94=A8update=20r?= =?UTF-8?q?=E9=87=8D=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/command/command.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/model/command/command.py b/model/command/command.py index b5653b4d2..365766577 100644 --- a/model/command/command.py +++ b/model/command/command.py @@ -82,9 +82,6 @@ class Command: pash_tag = "QQChannelChatGPT"+os.sep repo.remotes.origin.pull() - py = sys.executable - os.execl(py, py, *sys.argv) - # 检查是否是windows环境 # if platform.system().lower() == "windows": # if os.path.exists("launcher.exe"): @@ -97,9 +94,14 @@ class Command: # else: # py = sys.executable # os.execl(py, py, *sys.argv) + return True, "更新成功~是否重启?输入update reboot重启(重启指令不返回任何确认信息)。", "update" except BaseException as e: return False, "更新失败: "+str(e), "update" + if l[1] == "reboot": + py = sys.executable + os.execl(py, py, *sys.argv) + def reset(self): return False