From b0586cec231816c554ad75e8d8d4817665a66433 Mon Sep 17 00:00:00 2001 From: Zhao Zuohong Date: Mon, 23 Sep 2024 17:49:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 5 ++++- ui/src/pages/Init.vue | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 7025022..c0ea37d 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,6 @@ import json import os +import shlex from pathlib import Path from subprocess import PIPE, STDOUT, Popen @@ -37,8 +38,10 @@ class Api: config["page"] = page def run(self, command, cwd=None): + command = shlex.split(command) + command[0] = os.path.normpath(command) with Popen( - os.path.normpath(command), + command, stdout=PIPE, stderr=STDOUT, shell=True, diff --git a/ui/src/pages/Init.vue b/ui/src/pages/Init.vue index 1850d3d..20fed4b 100644 --- a/ui/src/pages/Init.vue +++ b/ui/src/pages/Init.vue @@ -1,7 +1,7 @@