$LASTEXITPR 오류
This commit is contained in:
1 parent
eb52bbd9d3
commit
fc8faeafa5
1 file changed
+3
-11
+3
-11
@@ -120,13 +120,10 @@ Info "Installing Pi Coding Agent..."
|
||||
$piCmd = Get-Command pi -ErrorAction SilentlyContinue
|
||||
if ($piCmd) {
|
||||
$currentVer = & pi --version 2>$null
|
||||
if ($LASTEXITPR -ne 0) { $currentVer = "unknown" }
|
||||
if (-not $currentVer) { $currentVer = "unknown" }
|
||||
Info "Pi is already installed (version: $currentVer). Skipping installation."
|
||||
} else {
|
||||
npm install -g $PI_NPM_PACKAGE
|
||||
if ($LASTEXITPR -ne 0) {
|
||||
ErrExit "Pi installation failed."
|
||||
}
|
||||
npm install -g $PI_NPM_PACKAGE 2>&1 | Out-Null
|
||||
Success "Pi installed via npm"
|
||||
}
|
||||
|
||||
@@ -153,7 +150,7 @@ if (-not $piBin) {
|
||||
# 3) Try common npm global locations
|
||||
if (-not $piBin) {
|
||||
$npmPrefix = & npm config get prefix 2>$null
|
||||
if ($LASTEXITPR -eq 0 -and $npmPrefix) {
|
||||
if (-not [string]::IsNullOrEmpty($npmPrefix)) {
|
||||
$candidate = Join-Path $npmPrefix 'pi.cmd'
|
||||
if (Test-Path $candidate) { $piBin = $candidate }
|
||||
if (-not $piBin) {
|
||||
@@ -228,12 +225,7 @@ if ($SkipPackages) {
|
||||
Info "[$count/$total] $name - $desc"
|
||||
try {
|
||||
& $piBin install "npm:$name" 2>&1 | Out-Null
|
||||
if ($LASTEXITPR -eq 0) {
|
||||
Success " -> $name installed"
|
||||
} else {
|
||||
Warn " -> $name failed (install manually later: pi install npm:$name)"
|
||||
$failed += $name
|
||||
}
|
||||
} catch {
|
||||
Warn " -> $name failed (install manually later: pi install npm:$name)"
|
||||
$failed += $name
|
||||
|
||||
Reference in new issue
Block a user