Windows路径修复

This commit is contained in:
zhbaor 2024-09-23 18:08:21 +08:00
parent c374f288b0
commit d9f1aae27c
4 changed files with 15 additions and 16 deletions

View file

@ -1,6 +1,4 @@
import json import json
import os
import shlex
from pathlib import Path from pathlib import Path
from subprocess import PIPE, STDOUT, Popen from subprocess import PIPE, STDOUT, Popen
@ -38,8 +36,6 @@ class Api:
config["page"] = page config["page"] = page
def run(self, command, cwd=None): def run(self, command, cwd=None):
command = shlex.split(command)
command[0] = os.path.normpath(command[0])
with Popen( with Popen(
command, command,
stdout=PIPE, stdout=PIPE,

View file

@ -1,10 +1,13 @@
<script setup> <script setup>
const steps = ref([ const steps = ref([
{ title: '设置Git LFS', command: ['git/bin/git lfs install'] }, { title: '设置Git LFS', command: ['git\\bin\\git lfs install'] },
{ title: '安装pip', command: ['python/python -m ensurepip --default-pip --no-warn-script-location'] }, {
title: '安装pip',
command: ['python\\python -m ensurepip --default-pip --no-warn-script-location']
},
{ {
title: '下载代码', title: '下载代码',
command: ['git/bin/git clone https://git.zhaozuohong.vip/mower-ng/mower-ng.git --branch slow'] command: ['git\\bin\\git clone https://git.zhaozuohong.vip/mower-ng/mower-ng.git --branch slow']
} }
]) ])
provide('steps', steps) provide('steps', steps)

View file

@ -1,10 +1,10 @@
<script setup> <script setup>
function webview() { function webview() {
pywebview.api.run('start ../python/pythonw webview_ui.py', './mower-ng') pywebview.api.run('start ..\\python\\pythonw webview_ui.py', 'mower-ng')
} }
function manager() { function manager() {
pywebview.api.run('start ../python/pythonw manager.py', './mower-ng') pywebview.api.run('start ..\\python\\pythonw manager.py', 'mower-ng')
} }
</script> </script>

View file

@ -11,22 +11,22 @@ watch(branch, () => {
pywebview.api.set_branch(branch.value) pywebview.api.set_branch(branch.value)
}) })
const steps = ref([ const steps = computed(() => [
{ {
title: '下载源码', title: '下载源码',
command: [ command: [
'../git/bin/git fetch', '..\\git\\bin\\git fetch',
`../git/bin/git switch -f ${branch.value}`, `..\\git\\bin\\git switch -f ${branch.value}`,
`../git/bin/git reset --hard origin/${branch.value}` `..\\git\\bin\\git reset --hard origin/${branch.value}`
], ],
cwd: './mower-ng' cwd: 'mower-ng'
}, },
{ {
title: '安装依赖', title: '安装依赖',
command: [ 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) provide('steps', steps)