Fix validateBuild failing due to npm output capture
Ensure Invoke-Npm streams output to host and returns only exit code. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
4361178413
commit
9e28f3db3f
@@ -55,7 +55,10 @@ function Invoke-Npm {
|
||||
$args += '--'
|
||||
$args += $ExtraArgs
|
||||
}
|
||||
& npm @args
|
||||
# Prevent npm stdout/stderr from becoming pipeline output for the caller.
|
||||
# Without this, callers that assign the function result to a variable can
|
||||
# accidentally capture npm's printed output instead of only exit code.
|
||||
& npm @args 2>&1 | Out-Host
|
||||
return $LASTEXITCODE
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user