fix error and new docs
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user