From b7a81c1ce1144de98565f01783d1d8b81c4f9be4 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Thu, 30 Nov 2023 15:01:44 -0500 Subject: [PATCH] Fix command failure not resulting in task failure For whatever reason (I don't understand this stuff well) the `win-podman-machine-main.ps1` script exits successfully despite the final `Check-Exit` showing a non-zero exit code was detected. Attempt to fix this by throwing an exception instead of calling `Exit`. Signed-off-by: Chris Evich --- contrib/cirrus/win-lib.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/cirrus/win-lib.ps1 b/contrib/cirrus/win-lib.ps1 index 4d87ba23df..63f0cc32f9 100644 --- a/contrib/cirrus/win-lib.ps1 +++ b/contrib/cirrus/win-lib.ps1 @@ -51,7 +51,7 @@ function Check-Exit { # https://learn.microsoft.com/en-us/dotnet/api/system.management.automation.callstackframe $caller = (Get-PSCallStack)[1] Write-Host "Exit code = '$result' from $($caller.ScriptName):$($caller.ScriptLineNumber)" - Exit $result + Throw "Non-zero exit code" } }