Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #834 : error reportfile without directory specified #842

Merged
merged 2 commits into from Oct 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/ReportWriter.cs
Expand Up @@ -15,6 +15,12 @@ public static void Write(string reportPath, IEnumerable<FormattedFile> formatted
var reportFilePath = GetReportFilePath(reportPath);
var reportFolderPath = Path.GetDirectoryName(reportFilePath);

// If no folder path is specified to the report path, set it to "." (which is the current working directory)
if (string.Empty.Equals(reportFolderPath, StringComparison.OrdinalIgnoreCase))
{
reportFolderPath = ".";
Styxxy marked this conversation as resolved.
Show resolved Hide resolved
}

if (reportFolderPath != null && !Directory.Exists(reportFolderPath))
{
Directory.CreateDirectory(reportFolderPath);
Expand Down