fix: 改进jq安装脚本的错误处理和日志输出
Some checks failed
Build Windows / ACT Windows Checkout Verification (push) Successful in 7h0m17s
Build Windows / build (push) Has been cancelled
Build Windows / 编译 libcore (Windows) (20.15.1) (push) Has been cancelled

添加错误日志输出和文件清理逻辑,便于调试安装失败问题
This commit is contained in:
shanshanzhong 2025-11-07 04:45:09 -08:00
parent ad5d0c9b7a
commit fed0b0e422

View File

@ -40,16 +40,24 @@ echo choco install jq -y >> install_jq.ps1
echo $env:Path = [System.Environment]::GetEnvironmentVariable('Path','Machine') + ';' + [System.Environment]::GetEnvironmentVariable('Path','User') >> install_jq.ps1
echo jq --version >> install_jq.ps1
:: 执行 PowerShell 脚本
powershell -NoProfile -ExecutionPolicy Bypass -File install_jq.ps1
if %ERRORLEVEL% neq 0 (
echo ❌ jq 安装失败
:: 执行 PowerShell 脚本并捕获输出
powershell -NoProfile -ExecutionPolicy Bypass -File install_jq.ps1 > install_jq_output.txt 2>&1
set PS_EXIT=%ERRORLEVEL%
:: 输出日志以调试
type install_jq_output.txt
echo PowerShell exit code: %PS_EXIT%
if %PS_EXIT% neq 0 (
echo ❌ jq 安装失败 (exit %PS_EXIT%)
del install_jq.ps1
del install_jq_output.txt
exit /b 1
)
:: 清理临时文件
del install_jq.ps1
del install_jq_output.txt
echo ✅ jq 安装成功