Skip to content

Commit

Permalink
append extension to result filename if non is provided. Fixes #146
Browse files Browse the repository at this point in the history
  • Loading branch information
tonerdo committed Jul 14, 2018
1 parent 1b517ae commit 4efea75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/coverlet.console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ static int Main(string[] args)

var filename = Path.GetFileName(dOutput);
filename = (filename == string.Empty) ? $"coverage.{reporter.Extension}" : filename;
filename = Path.HasExtension(filename) ? filename : $"{filename}.{reporter.Extension}";

var report = Path.Combine(directory, filename);
logger.LogInformation($" Generating report '{report}'");
Expand Down
1 change: 1 addition & 0 deletions src/coverlet.msbuild.tasks/CoverageResultTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public override bool Execute()

var filename = Path.GetFileName(_output);
filename = (filename == string.Empty) ? $"coverage.{reporter.Extension}" : filename;
filename = Path.HasExtension(filename) ? filename : $"{filename}.{reporter.Extension}";

var report = Path.Combine(directory, filename);
Console.WriteLine($" Generating report '{report}'");
Expand Down

0 comments on commit 4efea75

Please sign in to comment.