diff --git a/NUnit HTML Report Generator/Program.cs b/NUnit HTML Report Generator/Program.cs index b6b474e..eb7393c 100644 --- a/NUnit HTML Report Generator/Program.cs +++ b/NUnit HTML Report Generator/Program.cs @@ -155,9 +155,27 @@ private static bool CheckInputAndOutputFile(string input, string output) Console.WriteLine("File does not exist"); } + if (ok) + { + CreateFolder(output); + } + return ok; } + /// + /// Creates the folder of a file path if it doesn't exist + /// + /// The path to the file + private static void CreateFolder(string folderPath) + { + string fullPath = Path.GetFullPath(folderPath); + if (!Directory.Exists(folderPath)) + { + Directory.CreateDirectory(folderPath); + } + } + #endregion #region Processing