diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index f11a735..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/build_service.ps1 b/build_service.ps1 index 16d9714..d85bbea 100644 --- a/build_service.ps1 +++ b/build_service.ps1 @@ -1,20 +1,25 @@ # 创建并清理资源目录 New-Item -ItemType Directory -Path ./resources -Force -Remove-Item -Recurse -Force ./resources/* +Remove-Item -Recurse -Force ./resources/* -ErrorAction SilentlyContinue New-Item -ItemType Directory -Path ./resources -Force +# 获取当前工作目录的绝对路径 +$currentDir = (Get-Location).Path + # 并行构建 renderer 和 service $rendererJob = Start-Job -ScriptBlock { - cd ./renderer + param($workDir) + Set-Location -Path "$workDir\renderer" npm run build - mv ./dist ../resources/renderer -} + Move-Item -Path "./dist" -Destination "$workDir\resources\renderer" -Force +} -ArgumentList $currentDir $serviceJob = Start-Job -ScriptBlock { - cd ./service + param($workDir) + Set-Location -Path "$workDir\service" npm run build - mv ./dist ../resources/service -} + Move-Item -Path "./dist" -Destination "$workDir\resources\service" -Force +} -ArgumentList $currentDir # 等待任务完成 $rendererJob | Wait-Job | Receive-Job