refactor(copy_libcore): 移除jq安装步骤并简化脚本流程
Some checks failed
Build Windows / ACT Windows Checkout Verification (push) Successful in 7h0m19s
Build Windows / 编译 libcore (Windows) (20.15.1) (push) Successful in 19m22s
Build Windows / build (push) Failing after 7h0m26s

This commit is contained in:
shanshanzhong 2025-11-07 05:18:16 -08:00
parent f75b109025
commit 29c6e40940

View File

@ -22,46 +22,7 @@ for /r %%f in (libcore.dll) do (
if exist "%%f" (
echo ✅ 找到 libcore.dll: %%f
copy "%%f" libcore\bin\libcore.dll
goto :install_jq
)
)
echo ⚠️ 未找到 libcore.dll
:install_jq
echo 📦 安装 jq...
:: 创建临时 PowerShell 脚本文件
echo if (!(Get-Command choco -ErrorAction SilentlyContinue)) { > install_jq.ps1
echo Set-ExecutionPolicy Bypass -Scope Process -Force; >> install_jq.ps1
echo [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; >> install_jq.ps1
echo iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) >> install_jq.ps1
echo } >> install_jq.ps1
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 > 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 安装成功
goto :verify
goto :verify
:verify
echo.