- 优化Windows打包
This commit is contained in:
parent
85396df221
commit
36c046ad6a
12
app/main.py
12
app/main.py
@ -63,10 +63,16 @@ def start_frontend():
|
||||
if not SystemUtils.is_frozen():
|
||||
return
|
||||
nginx_path = settings.ROOT_PATH / 'nginx'
|
||||
nginx = 'nginx.exe' if SystemUtils.is_windows() else 'nginx'
|
||||
if Path(nginx_path).exists():
|
||||
if not nginx_path.exists():
|
||||
return
|
||||
import subprocess
|
||||
subprocess.Popen(f"cd {nginx_path}; start {nginx}",
|
||||
if SystemUtils.is_windows():
|
||||
subprocess.Popen("start nginx.exe",
|
||||
cwd=nginx_path,
|
||||
shell=True)
|
||||
else:
|
||||
subprocess.Popen("nohup ./nginx &",
|
||||
cwd=nginx_path,
|
||||
shell=True)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user