Skip to content

Commit

Permalink
remove redundant Directory.GetCurrentDirectory (#10074)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Jul 9, 2024
1 parent c8409b4 commit d3c3327
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/docfx/Models/BuildCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ internal static void MergeOptionsToConfig(BuildCommandOptions options, BuildJson
// base directory for content from command line is current directory
// e.g. C:\folder1>docfx build folder2\docfx.json --content "*.cs"
// for `--content "*.cs*`, base directory should be `C:\folder1`
string optionsBaseDirectory = Directory.GetCurrentDirectory();
// hence GetFullPath used below

// Override config file with options from command line
if (options.Templates != null && options.Templates.Any())
Expand Down
3 changes: 1 addition & 2 deletions src/docfx/Models/MergeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ private static void MergeOptionsToConfig(MergeCommandOptions options, ref MergeJ
// base directory for content from command line is current directory
// e.g. C:\folder1>docfx build folder2\docfx.json --content "*.cs"
// for `--content "*.cs*`, base directory should be `C:\folder1`
string optionsBaseDirectory = Directory.GetCurrentDirectory();

// hence GetFullPath used
if (!string.IsNullOrEmpty(options.OutputFolder)) config.Destination = Path.GetFullPath(Path.Combine(options.OutputFolder, config.Destination ?? string.Empty));
}
}

0 comments on commit d3c3327

Please sign in to comment.