32 lines
829 B
C#
Raw Normal View History

2021-09-10 12:42:30 +01:00
using System.IO;
2021-09-07 17:45:49 +01:00
namespace QuestValidator.Helpers
{
public static class DiskHelpers
{
public static void CreateDirIfDoesntExist(string path)
{
if (!Directory.Exists($"{path}"))
{
//create dump dir
Directory.CreateDirectory($"{path}");
}
}
public static string[] GetJsonFiles(string path)
{
return Directory.GetFiles(path, "*.json", SearchOption.TopDirectoryOnly);
}
2021-09-10 12:42:30 +01:00
public static string CreateWorkingFolders()
{
var workingPath = Directory.GetCurrentDirectory();
// create input folder
var inputPath = $"{workingPath}//input";
DiskHelpers.CreateDirIfDoesntExist(inputPath);
return inputPath;
}
2021-09-07 17:45:49 +01:00
}
}