Files
EveryPublish/client/ui/Packaging/precheck.ps1
T

32 lines
1.0 KiB
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# EveryPublish Windows 构建前环境自检(PowerShell)
Write-Host "=== EveryPublish Windows 构建自检 ===" -ForegroundColor Cyan
function Check($name, $cmd) {
try {
$out = Invoke-Expression $cmd 2>&1 | Out-String
$first = ($out.Trim() -split "`n")[0]
Write-Host "[OK] $name : $first" -ForegroundColor Green
return $true
} catch {
Write-Host "[FAIL] $name 未安装或不可用" -ForegroundColor Red
return $false
}
}
$ok = $true
$ok = (Check "dotnet SDK" "dotnet --version") -and $ok
$ok = (Check "Go 工具链" "go version") -and $ok
# 版本校验:.NET 需 8.x,Go 需 1.23+
$dotnetVer = (dotnet --version 2>$null)
if ($dotnetVer -and -not $dotnetVer.StartsWith("8.")) {
Write-Host "[WARN] dotnet 版本 $dotnetVer,建议 .NET 8 SDK" -ForegroundColor Yellow
}
if (-not $ok) {
Write-Host "请先安装依赖(见 client/ui/README.md)后重试" -ForegroundColor Red
exit 1
}
Write-Host "环境就绪:可运行 Packaging\build-installer.ps1 打包" -ForegroundColor Green