Skip to content

Commit

Permalink
Merge pull request #202 from AArnott/fix197
Browse files Browse the repository at this point in the history
Return exit code 3 from SignClient when no files will be signed
  • Loading branch information
clairernovotny authored Mar 14, 2020
2 parents e258751 + f240047 commit d5aba76
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/SignClient/SignCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ static class EXIT_CODES
public const int SUCCESS = 0;
public const int INVALID_OPTIONS = 1;
public const int FAILED = 2;
public const int NO_INPUTS_FOUND = 3;
}

public SignCommand(CommandLineApplication signCommandLineApplication)
Expand Down Expand Up @@ -168,6 +169,12 @@ CommandOption maxConcurrency
return EXIT_CODES.INVALID_OPTIONS;
}

if (inputFiles.Count == 0)
{
signCommandLineApplication.Error.WriteLine("No inputs found to sign.");
return EXIT_CODES.NO_INPUTS_FOUND;
}

Parallel.ForEach(inputFiles,new ParallelOptions { MaxDegreeOfParallelism = maxC } , input =>
{
FileInfo output;
Expand Down

0 comments on commit d5aba76

Please sign in to comment.