Skip to content

Commit

Permalink
Issue RicoSuter#78 - Creating output directory if it doesn't exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
jkonecki committed May 20, 2016
1 parent 1d97615 commit bd3a7af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/NSwag/Commands/Base/OutputCommandBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ protected void WriteOutput(IConsoleHost host, string output)
host.WriteMessage(output);
else
{
var file = new FileInfo(OutputFilePath);
var directory = file.Directory;

if (!directory.Exists)
directory.Create();

File.WriteAllText(OutputFilePath, output, Encoding.UTF8);
host.WriteMessage("Code has been successfully written to file.\n");
}
Expand Down
Binary file added src/UpgradeLog.htm
Binary file not shown.

0 comments on commit bd3a7af

Please sign in to comment.