Skip to content

Commit

Permalink
Output correct error codes actions#351
Browse files Browse the repository at this point in the history
Output correct error codes actions#351
  • Loading branch information
anthonysessa authored Oct 28, 2020
1 parent d23ca0b commit 1ccd62e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Runner.Worker/Handlers/ScriptHandlerHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal static string FixUpScriptContents(string scriptType, string contents)
case "powershell":
case "pwsh":
var prepend = "$ErrorActionPreference = 'stop'";
var append = @"if ((Test-Path -LiteralPath variable:\LASTEXITCODE)) { exit $LASTEXITCODE }";
var append = @"if (Test-Path -LiteralPath variable:\LASTEXITCODE) { $Host.SetShouldExit($LASTEXITCODE) }";
contents = $"{prepend}{Environment.NewLine}{contents}{Environment.NewLine}{append}";
break;
}
Expand Down

0 comments on commit 1ccd62e

Please sign in to comment.