From 1d6276b112f2748e76c07b96500e3f5d2d974e3e Mon Sep 17 00:00:00 2001 From: Beepboop Belong the 3rd Date: Wed, 15 Apr 2020 12:20:29 +0200 Subject: [PATCH] Made folder creation recursive --- .gitignore | 1 + source/config/downloaderconfig.d | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index c4cc2c4..de665b4 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ hentai_downloader-test-* *.obj *.lst list.txt +*.log diff --git a/source/config/downloaderconfig.d b/source/config/downloaderconfig.d index 04f7d0e..2d7a19a 100644 --- a/source/config/downloaderconfig.d +++ b/source/config/downloaderconfig.d @@ -33,7 +33,7 @@ class DownloaderConfig static private: import std.stdio : writeln; import std.json : JSONValue, parseJSON; - import std.file : exists, mkdir, readText, copy; + import std.file : exists, readText, copy, mkdirRecurse; import std.stdio : toFile; import std.string: strip; import std.array : replace; @@ -83,7 +83,7 @@ static private: // if the folder ~/.config/hentai_downloader doesnt exist if(!exists(config_dir)) - mkdir(config_dir); // Create it + mkdirRecurse(config_dir); // Create it /* writeln("Config file: ", config_path); */ @@ -117,7 +117,7 @@ static private: if(!exists(absolutePath)) { // If the `standard_download_folder` doesnt exist, create it! - absolutePath.mkdir(); + absolutePath.mkdirRecurse(); } }