fix(local-tool): PowerShell 5.1 compatibility for bootstrap-windows.ps1

- 改用陣列 + -join ' && ' 組 bash 指令,避開 PS5.1 不支援 && 運算子
- 加入 UTF-8 BOM,避免 Windows 10 預設用 ANSI/Big5 解讀造成中文亂碼

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
jim800121chen 2026-04-12 01:44:06 +08:00
parent 5a8d2797c2
commit ba15097e9d

View File

@ -1,4 +1,4 @@
# visionA-local — Windows 10/11 x86_64 一鍵 build # visionA-local — Windows 10/11 x86_64 一鍵 build
# #
# 使用方式PowerShell 以「系統管理員」開啟): # 使用方式PowerShell 以「系統管理員」開啟):
# git clone https://github.com/jim800121/visionA.git # git clone https://github.com/jim800121/visionA.git
@ -76,17 +76,21 @@ $projectPath = (Get-Location).Path
$msysPath = '/' + $projectPath.Substring(0,1).ToLower() + '/' + ` $msysPath = '/' + $projectPath.Substring(0,1).ToLower() + '/' + `
($projectPath.Substring(3) -replace '\\','/') ($projectPath.Substring(3) -replace '\\','/')
$bashCmd = "cd '$msysPath' && " + $bashParts = @(
"export VISIONA_ALLOW_GPL_FFMPEG=1 && " + "cd '$msysPath'",
"make vendor-python-windows vendor-wheels-windows vendor-ffmpeg-windows vendor-ytdlp-windows && " + 'export VISIONA_ALLOW_GPL_FFMPEG=1',
"make payload-windows" 'make vendor-python-windows vendor-wheels-windows vendor-ffmpeg-windows vendor-ytdlp-windows',
'make payload-windows'
)
switch ($Target) { switch ($Target) {
'payload-windows' { } 'payload-windows' { }
'wails-windows' { $bashCmd += ' && make wails-windows' } 'wails-windows' { $bashParts += 'make wails-windows' }
default { $bashCmd += ' && make wails-windows && make exe' } default { $bashParts += 'make wails-windows'; $bashParts += 'make exe' }
} }
$bashCmd = $bashParts -join ' && '
& 'C:\msys64\usr\bin\bash.exe' -lc $bashCmd & 'C:\msys64\usr\bin\bash.exe' -lc $bashCmd
if ($LASTEXITCODE -ne 0) { Fail "build 失敗exit code=$LASTEXITCODE" } if ($LASTEXITCODE -ne 0) { Fail "build 失敗exit code=$LASTEXITCODE" }