更新 win 上的打包脚本

This commit is contained in:
锦恢 2025-04-22 04:10:18 +08:00
parent fcf3b8cb9f
commit 03d79d0222
2 changed files with 12 additions and 7 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -1,20 +1,25 @@
# 创建并清理资源目录 # 创建并清理资源目录
New-Item -ItemType Directory -Path ./resources -Force 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 New-Item -ItemType Directory -Path ./resources -Force
# 获取当前工作目录的绝对路径
$currentDir = (Get-Location).Path
# 并行构建 renderer 和 service # 并行构建 renderer 和 service
$rendererJob = Start-Job -ScriptBlock { $rendererJob = Start-Job -ScriptBlock {
cd ./renderer param($workDir)
Set-Location -Path "$workDir\renderer"
npm run build npm run build
mv ./dist ../resources/renderer Move-Item -Path "./dist" -Destination "$workDir\resources\renderer" -Force
} } -ArgumentList $currentDir
$serviceJob = Start-Job -ScriptBlock { $serviceJob = Start-Job -ScriptBlock {
cd ./service param($workDir)
Set-Location -Path "$workDir\service"
npm run build npm run build
mv ./dist ../resources/service Move-Item -Path "./dist" -Destination "$workDir\resources\service" -Force
} } -ArgumentList $currentDir
# 等待任务完成 # 等待任务完成
$rendererJob | Wait-Job | Receive-Job $rendererJob | Wait-Job | Receive-Job