From ba15097e9d625b52cc56a6deb19d5b5cd9476b2b Mon Sep 17 00:00:00 2001 From: jim800121chen Date: Sun, 12 Apr 2026 01:44:06 +0800 Subject: [PATCH] fix(local-tool): PowerShell 5.1 compatibility for bootstrap-windows.ps1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 改用陣列 + -join ' && ' 組 bash 指令,避開 PS5.1 不支援 && 運算子 - 加入 UTF-8 BOM,避免 Windows 10 預設用 ANSI/Big5 解讀造成中文亂碼 Co-Authored-By: Claude Opus 4.6 (1M context) --- local-tool/scripts/bootstrap-windows.ps1 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/local-tool/scripts/bootstrap-windows.ps1 b/local-tool/scripts/bootstrap-windows.ps1 index ae49899..206d9f9 100644 --- a/local-tool/scripts/bootstrap-windows.ps1 +++ b/local-tool/scripts/bootstrap-windows.ps1 @@ -1,4 +1,4 @@ -# visionA-local — Windows 10/11 x86_64 一鍵 build +# visionA-local — Windows 10/11 x86_64 一鍵 build # # 使用方式(PowerShell 以「系統管理員」開啟): # git clone https://github.com/jim800121/visionA.git @@ -76,17 +76,21 @@ $projectPath = (Get-Location).Path $msysPath = '/' + $projectPath.Substring(0,1).ToLower() + '/' + ` ($projectPath.Substring(3) -replace '\\','/') -$bashCmd = "cd '$msysPath' && " + - "export VISIONA_ALLOW_GPL_FFMPEG=1 && " + - "make vendor-python-windows vendor-wheels-windows vendor-ffmpeg-windows vendor-ytdlp-windows && " + - "make payload-windows" +$bashParts = @( + "cd '$msysPath'", + 'export VISIONA_ALLOW_GPL_FFMPEG=1', + 'make vendor-python-windows vendor-wheels-windows vendor-ffmpeg-windows vendor-ytdlp-windows', + 'make payload-windows' +) switch ($Target) { 'payload-windows' { } - 'wails-windows' { $bashCmd += ' && make wails-windows' } - default { $bashCmd += ' && make wails-windows && make exe' } + 'wails-windows' { $bashParts += 'make wails-windows' } + default { $bashParts += 'make wails-windows'; $bashParts += 'make exe' } } +$bashCmd = $bashParts -join ' && ' + & 'C:\msys64\usr\bin\bash.exe' -lc $bashCmd if ($LASTEXITCODE -ne 0) { Fail "build 失敗,exit code=$LASTEXITCODE" }