diff --git a/main.py b/main.py index 5e72fc3..07e0e1d 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,4 @@ import json -import os -import shlex from pathlib import Path from subprocess import PIPE, STDOUT, Popen @@ -38,8 +36,6 @@ class Api: config["page"] = page def run(self, command, cwd=None): - command = shlex.split(command) - command[0] = os.path.normpath(command[0]) with Popen( command, stdout=PIPE, diff --git a/ui/src/pages/Init.vue b/ui/src/pages/Init.vue index e8028a5..a6aa830 100644 --- a/ui/src/pages/Init.vue +++ b/ui/src/pages/Init.vue @@ -1,10 +1,13 @@ diff --git a/ui/src/pages/Update.vue b/ui/src/pages/Update.vue index ad1c9b2..4d60e5c 100644 --- a/ui/src/pages/Update.vue +++ b/ui/src/pages/Update.vue @@ -11,22 +11,22 @@ watch(branch, () => { pywebview.api.set_branch(branch.value) }) -const steps = ref([ +const steps = computed(() => [ { title: '下载源码', command: [ - '../git/bin/git fetch', - `../git/bin/git switch -f ${branch.value}`, - `../git/bin/git reset --hard origin/${branch.value}` + '..\\git\\bin\\git fetch', + `..\\git\\bin\\git switch -f ${branch.value}`, + `..\\git\\bin\\git reset --hard origin/${branch.value}` ], - cwd: './mower-ng' + cwd: 'mower-ng' }, { title: '安装依赖', command: [ - '../python/Scripts/pip install -i https://mirror.sjtu.edu.cn/pypi/web/simple -r requirements.txt --no-warn-script-location' + '..\\python\\Scripts\\pip install -i https://mirror.sjtu.edu.cn/pypi/web/simple -r requirements.txt --no-warn-script-location' ], - cwd: './mower-ng' + cwd: 'mower-ng' } ]) provide('steps', steps)