From fc8faeafa5821b0bf061716339ea429880150697 Mon Sep 17 00:00:00 2001 From: Jerry Chae Date: Wed, 13 May 2026 20:07:06 +0900 Subject: [PATCH] =?UTF-8?q?$LASTEXITPR=20=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install-pi.ps1 | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/install-pi.ps1 b/install-pi.ps1 index 24501b2..2212aa3 100644 --- a/install-pi.ps1 +++ b/install-pi.ps1 @@ -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 - } + Success " -> $name installed" } catch { Warn " -> $name failed (install manually later: pi install npm:$name)" $failed += $name