Skip to content

Commit

Permalink
(GH-1724) search - exit 2 on no results
Browse files Browse the repository at this point in the history
Preserve 1 and -1 for errors. No results should have something more
deterministic, and 2 would provide that.
  • Loading branch information
ferventcoder committed Mar 14, 2019
1 parent 606e855 commit a471a87
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,10 @@ public virtual void run(ChocolateyConfiguration configuration)
// note: you must leave the .ToList() here or else the method won't be evaluated!
var packageResults = _packageService.list_run(configuration).ToList();

// if there are no results, exit with a 1.
// if there are no results, exit with a 2.
if (configuration.Features.UseEnhancedExitCodes && packageResults.Count == 0 && Environment.ExitCode == 0)
{
Environment.ExitCode = 1;
Environment.ExitCode = 2;
}
}

Expand Down

0 comments on commit a471a87

Please sign in to comment.