fix(install): report source UI build failures correctly (#112053)

This commit is contained in:
ooiuuii
2026-07-25 20:42:23 +08:00
committed by GitHub
parent 7f70fb3521
commit ceeb861418
2 changed files with 4 additions and 1 deletions

View File

@@ -1538,7 +1538,8 @@ function Install-OpenClawFromGit {
Write-Host "[!] pnpm install failed for the Git checkout" -ForegroundColor Red
return $false
}
if (-not (& $pnpmCommand ui:build)) {
& $pnpmCommand ui:build
if ($LASTEXITCODE -ne 0) {
Write-Host "[!] UI build failed; continuing (CLI may still work)" -ForegroundColor Yellow
}
$env:NODE_OPTIONS = Resolve-NodeOptionsWithMinOldSpace -NodeOptions $prevNodeOptions -MinOldSpaceMb 8192

View File

@@ -935,6 +935,8 @@ describe("install.ps1 failure handling", () => {
expect(gitInstallBody).toContain(
"$env:NODE_OPTIONS = Resolve-NodeOptionsWithMinOldSpace -NodeOptions $prevNodeOptions -MinOldSpaceMb 8192",
);
expect(gitInstallBody).toMatch(/& \$pnpmCommand ui:build\s+if \(\$LASTEXITCODE -ne 0\)/);
expect(gitInstallBody).not.toContain("if (-not (& $pnpmCommand ui:build))");
expect(nodeOptionsBody).toContain("--max-old-space-size=$MinOldSpaceMb");
expect(nodeOptionsBody).toContain("[Math]::Max");
expect(gitInstallBody).toContain("& $pnpmCommand build");