提交 e6c7c941 编写于 作者: J Jared Parsons 提交者: Jared Parsons

Properly check return of Invoke-Expression

In cibuild-legacy.ps1 we cannot use Exec-Expression because it's a
bootstrapping problem.  Hence we have to use Invoke-Expression directly.

Even though we invoke a script via Invoke-Expression here we still must
check $LastExitCode.  In the case where the script exits explicitly with
an exit code this doesn't actually cause $? to be $false.  Hence we
still must check both values here.
上级 bb4de4a1
......@@ -25,4 +25,7 @@ Write-Host "!!!This script is legacy and will be deleted. Please call build/scr
Write-Host "New Args are $newArgs"
$script = Join-Path $PSScriptRoot "cibuild.ps1"
Invoke-Expression "$script $newArgs"
if ((-not $?) -or ($lastexitcode -ne 0)) {
exit 1
}
Write-Host "!!!This script is legacy and will be deleted. Please call build/scripts/cibuild.cmd directly!!!"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册