From 85396df2216b0b2322115236c7448b206bb7138c Mon Sep 17 00:00:00 2001 From: jxxghp Date: Tue, 10 Oct 2023 20:06:52 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BC=98=E5=8C=96Windows=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/main.py b/app/main.py index a84a85c5..d362166f 100644 --- a/app/main.py +++ b/app/main.py @@ -62,13 +62,12 @@ def start_frontend(): """ if not SystemUtils.is_frozen(): return - if SystemUtils.is_windows(): - nginx_path = settings.ROOT_PATH / 'nginx' / 'nginx.exe' - else: - nginx_path = settings.ROOT_PATH / 'nginx' / 'nginx' + nginx_path = settings.ROOT_PATH / 'nginx' + nginx = 'nginx.exe' if SystemUtils.is_windows() else 'nginx' if Path(nginx_path).exists(): import subprocess - subprocess.Popen(f"./{nginx_path}", shell=True) + subprocess.Popen(f"cd {nginx_path}; start {nginx}", + shell=True) def stop_frontend():