Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/swift_package_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -920,10 +920,17 @@ jobs:

# Run the command following `Invoke-Program`.
# If that command returns a non-zero exit code, return the same exit code from this script.
# When there is no exit code (e.g. program failed to launch), we fall back to $?.
function Invoke-Program($Executable) {
$global:LASTEXITCODE = $null
& $Executable @args
if ($LastExitCode -ne 0) {
exit $LastExitCode
$ok = $?
if ($null -eq $LASTEXITCODE) {
if (-not $ok) {
exit 1
}
} elseif ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
}
Invoke-Program swift --version
Expand Down
Loading