Skip to content

Commit

Permalink
(GH-827) No really, ignore package exit codes
Browse files Browse the repository at this point in the history
If it is a valid exit code, choco used to set the exit code to zero.
Otherwise the exit code was set to 1. That behavior needs to continue to
be that way for the exit code of choco.exe when ignoring package exit
codes.
  • Loading branch information
ferventcoder committed Jun 23, 2016
1 parent b9d8759 commit 713df97
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack
failure = true;
}

if (!configuration.Features.UsePackageExitCodes)
{
Environment.ExitCode = failure ? 1 : 0;
}

if (failure)
{
packageResult.Messages.Add(new ResultMessage(ResultType.Error, "Error while running '{0}'.{1} See log for details.".format_with(chocoPowerShellScript, Environment.NewLine)));
Expand Down

0 comments on commit 713df97

Please sign in to comment.