fix error and new docs

This commit is contained in:
Ivan Fontosh
2026-05-18 10:16:48 +08:00
parent 10de99bb06
commit 1cda87fe13
+10 -1
View File
@@ -56,12 +56,21 @@ function Invoke-NpmRaw {
[string[]]$NpmArgs, [string[]]$NpmArgs,
[string]$WorkingDirectory [string]$WorkingDirectory
) )
$prevEap = $ErrorActionPreference
$ErrorActionPreference = 'Continue'
Push-Location $WorkingDirectory Push-Location $WorkingDirectory
try { try {
& npm @NpmArgs & npm @NpmArgs 2>&1 | ForEach-Object {
if ($_ -is [System.Management.Automation.ErrorRecord]) {
Write-Host $_.ToString()
} else {
Write-Host ([string]$_)
}
}
return $LASTEXITCODE return $LASTEXITCODE
} finally { } finally {
Pop-Location Pop-Location
$ErrorActionPreference = $prevEap
} }
} }