From 8ea4c4a6badc2e07e7cc6502bb887344e910fa2e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 28 Mar 2026 18:58:52 +0000 Subject: [PATCH] fix: tolerate npm stderr in Windows Parallels update smoke --- scripts/e2e/parallels-npm-update-smoke.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/e2e/parallels-npm-update-smoke.sh b/scripts/e2e/parallels-npm-update-smoke.sh index 204a7ac6a40..398d5adbe74 100755 --- a/scripts/e2e/parallels-npm-update-smoke.sh +++ b/scripts/e2e/parallels-npm-update-smoke.sh @@ -186,18 +186,25 @@ function Invoke-Logged { [Parameter(Mandatory = $true)][scriptblock]$Command ) + $output = $null $previousErrorActionPreference = $ErrorActionPreference $previousNativeErrorPreference = $PSNativeCommandUseErrorActionPreference try { $ErrorActionPreference = 'Continue' $PSNativeCommandUseErrorActionPreference = $false - & $Command *>> $LogPath + # Merge native stderr into stdout before logging so npm/openclaw warnings do not + # surface as PowerShell error records and abort a healthy in-place update. + $output = & $Command *>&1 $exitCode = $LASTEXITCODE } finally { $ErrorActionPreference = $previousErrorActionPreference $PSNativeCommandUseErrorActionPreference = $previousNativeErrorPreference } + if ($null -ne $output) { + $output | Tee-Object -FilePath $LogPath -Append | Out-Null + } + if ($exitCode -ne 0) { throw "$Label failed with exit code $exitCode" } @@ -214,7 +221,7 @@ function Invoke-CaptureLogged { try { $ErrorActionPreference = 'Continue' $PSNativeCommandUseErrorActionPreference = $false - $output = & $Command 2>&1 + $output = & $Command *>&1 $exitCode = $LASTEXITCODE } finally { $ErrorActionPreference = $previousErrorActionPreference