Skip to content

Commit

Permalink
error if no files match glob pattern irongut#31
Browse files Browse the repository at this point in the history
  • Loading branch information
irongut committed Feb 19, 2022
1 parent 009a545 commit ce279ec
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/CodeCoverageSummary/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ private static int Main(string[] args)
matcher.AddIncludePatterns(o.Files.ToArray());
IEnumerable<string> matchingFiles = matcher.GetResultsInFullPath(".");

if (matchingFiles?.Any() == false)
{
Console.WriteLine("Error: No files found matching glob pattern.");
return -2; // error
}

// check files exist
foreach (var file in matchingFiles)
{
Expand Down

0 comments on commit ce279ec

Please sign in to comment.