@@ -173,7 +173,7 @@ $extractedDir = Join-Path $tmpDir "source"
173173$spinner = Start-Spinner " Cloning repository..."
174174$ErrorActionPreference = " Continue"
175175git clone - c core.longpaths= true -- quiet https:// github.com / robertpiosik/ CodeWebChat.git $extractedDir * > $null
176- $cmdSuccess = $?
176+ $cmdSuccess = ( $LASTEXITCODE -eq 0 )
177177$ErrorActionPreference = " Stop"
178178Stop-Spinner $spinner $cmdSuccess
179179
@@ -188,7 +188,7 @@ Push-Location $extractedDir
188188$spinner = Start-Spinner " Installing dependencies..."
189189$ErrorActionPreference = " Continue"
190190npx.cmd -- yes pnpm install * > $null
191- $cmdSuccess = $?
191+ $cmdSuccess = ( $LASTEXITCODE -eq 0 )
192192Stop-Spinner $spinner $cmdSuccess
193193
194194if (! $cmdSuccess ) {
@@ -200,7 +200,7 @@ if (!$cmdSuccess) {
200200$spinner = Start-Spinner " Building extension..."
201201Set-Location apps/ editor
202202npx.cmd -- yes pnpm run build * > $null
203- $cmdSuccess = $?
203+ $cmdSuccess = ( $LASTEXITCODE -eq 0 )
204204$ErrorActionPreference = " Stop"
205205Stop-Spinner $spinner $cmdSuccess
206206
@@ -211,7 +211,7 @@ if (!$cmdSuccess) {
211211 exit 1
212212}
213213
214- $vsixFile = Get-ChildItem * .vsix | Select-Object - First 1
214+ $vsixFile = Get-ChildItem * .vsix - ErrorAction SilentlyContinue | Select-Object - First 1
215215
216216if (! $vsixFile ) {
217217 Write-Host " Error: VSIX file was not generated." - ForegroundColor Red
@@ -227,7 +227,7 @@ function Install-ToEditor($idx) {
227227 $spinner = Start-Spinner " Installing to $editorName ..."
228228 $ErrorActionPreference = " Continue"
229229 & $editorCmd -- install-extension $vsixFile.FullName -- force * > $null
230- $cmdSuccess = $?
230+ $cmdSuccess = ( $LASTEXITCODE -eq 0 )
231231 $ErrorActionPreference = " Stop"
232232
233233 Stop-Spinner $spinner $cmdSuccess
0 commit comments