mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-25 17:57:50 +01:00
25 lines
692 B
PowerShell
25 lines
692 B
PowerShell
# stop when there's an error
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
# set agent specific npm cache
|
|
if (Test-Path env:AGENT_WORKFOLDER) {
|
|
$env:npm_config_cache = "${env:AGENT_WORKFOLDER}\npm-cache"
|
|
}
|
|
|
|
# throw when a process exits with something other than 0
|
|
function exec([scriptblock]$cmd, [string]$errorMessage = "Error executing command: " + $cmd) {
|
|
& $cmd
|
|
if ($LastExitCode -ne 0) {
|
|
throw $errorMessage
|
|
}
|
|
}
|
|
|
|
# log build step
|
|
function STEP() {
|
|
Write-Host ""
|
|
Write-Host "********************************************************************************"
|
|
Write-Host "*** $args"
|
|
Write-Host "********************************************************************************"
|
|
Write-Host ""
|
|
}
|