mirror of https://github.com/rust-lang/rust.git
Return error code from x.ps1
This commit is contained in:
parent
82cd953c7c
commit
9ea7142a01
7
x.ps1
7
x.ps1
|
@ -16,7 +16,14 @@ function Get-Application($app) {
|
|||
|
||||
function Invoke-Application($application, $arguments) {
|
||||
$process = Start-Process -NoNewWindow -PassThru $application $arguments
|
||||
# WORKAROUND: Caching the handle is necessary to make ExitCode work.
|
||||
# See https://stackoverflow.com/a/23797762
|
||||
$handle = $process.Handle
|
||||
$process.WaitForExit()
|
||||
if ($null -eq $process.ExitCode) {
|
||||
Write-Error "Unable to read the exit code"
|
||||
Exit 1
|
||||
}
|
||||
Exit $process.ExitCode
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue