Move function to helper

This commit is contained in:
Chomp 2021-09-10 12:42:30 +01:00
parent 5bdb09c754
commit 56fbe22591
2 changed files with 12 additions and 13 deletions

View File

@ -1,5 +1,4 @@
using System; using System.IO;
using System.IO;
namespace QuestValidator.Helpers namespace QuestValidator.Helpers
{ {
@ -18,5 +17,15 @@ namespace QuestValidator.Helpers
{ {
return Directory.GetFiles(path, "*.json", SearchOption.TopDirectoryOnly); return Directory.GetFiles(path, "*.json", SearchOption.TopDirectoryOnly);
} }
public static string CreateWorkingFolders()
{
var workingPath = Directory.GetCurrentDirectory();
// create input folder
var inputPath = $"{workingPath}//input";
DiskHelpers.CreateDirIfDoesntExist(inputPath);
return inputPath;
}
} }
} }

View File

@ -13,7 +13,7 @@ namespace QuestValidator
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
var inputPath = CreateWorkingFolders(); var inputPath = DiskHelpers.CreateWorkingFolders();
InputFileHelper.SetInputFiles(inputPath); InputFileHelper.SetInputFiles(inputPath);
//read in quest file //read in quest file
@ -376,15 +376,5 @@ namespace QuestValidator
} }
} }
} }
private static string CreateWorkingFolders()
{
var workingPath = Directory.GetCurrentDirectory();
// create input folder
var inputPath = $"{workingPath}//input";
DiskHelpers.CreateDirIfDoesntExist(inputPath);
return inputPath;
}
} }
} }