From ebea4e41979e1508d1c1afb0c8a8d6c972ca8311 Mon Sep 17 00:00:00 2001 From: KimigaiiWuyi <444835641@qq.com> Date: Mon, 9 Jun 2025 17:19:39 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E4=BF=AE=E6=94=B9`core=E9=87=8D?= =?UTF-8?q?=E5=90=AF`=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core_command/core_restart/restart.py | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/gsuid_core/buildin_plugins/core_command/core_restart/restart.py b/gsuid_core/buildin_plugins/core_command/core_restart/restart.py index e174ae0..0479d2d 100644 --- a/gsuid_core/buildin_plugins/core_command/core_restart/restart.py +++ b/gsuid_core/buildin_plugins/core_command/core_restart/restart.py @@ -29,9 +29,15 @@ def get_restart_command(): return restart_command else: tool = check_start_tool() - if tool != 'python': - return f'{tool} run python' - return 'python' + if tool == 'uv': + return 'uv run core' + elif tool == 'pdm': + return 'pdm run core' + elif tool == 'poetry': + return 'poetry run core' + elif tool == 'python': + return 'python -m gsuid_core.core' + return 'python -m gsuid_core.core' async def get_restart_sh() -> str: @@ -52,8 +58,10 @@ async def restart_genshinuid( with open(restart_sh_path, "w", encoding="utf8") as f: f.write(restart_sh) if platform.system() == 'Linux': - os.system(f'chmod +x {str(restart_sh_path)}') - os.system(f'chmod +x {str(bot_start)}') + # os.system(f'chmod +x {str(restart_sh_path)}') + # os.system(f'chmod +x {str(bot_start)}') + pass + now_time = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(time.time())) if is_send: update_log = { @@ -69,12 +77,12 @@ async def restart_genshinuid( json.dump(update_log, f) if platform.system() == 'Linux': subprocess.Popen( - f'kill -9 {pid} & {get_restart_command()} {bot_start}', + f'kill -9 {pid} & {get_restart_command()}', shell=True, ) else: subprocess.Popen( - f'taskkill /F /PID {pid} & {get_restart_command()} {bot_start}', + f'taskkill /F /PID {pid} & {get_restart_command()}', shell=True, )