From 415ff438a2c4b912b662b3df860a03093bd32ded Mon Sep 17 00:00:00 2001 From: haszi Date: Fri, 10 May 2024 15:57:22 +0200 Subject: [PATCH] Add directory creation back to render.php with the same output as in Options Handler (#124) Co-authored-by: haszi --- render.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/render.php b/render.php index 4b81217d..cc625dc0 100644 --- a/render.php +++ b/render.php @@ -43,7 +43,13 @@ trigger_error("No Docbook file given. Specify it on the command line with --docbook.", E_USER_ERROR); } if (!file_exists(Config::output_dir())) { - v("Output directory doesn't exist", E_USER_ERROR); + v("Creating output directory..", VERBOSE_MESSAGES); + if (!mkdir(Config::output_dir(), 0777, True)) { + v("Can't create output directory : %s", Config::output_dir(), E_USER_ERROR); + } + v("Output directory created", VERBOSE_MESSAGES); +} elseif (!is_dir(Config::output_dir())) { + v("Output directory is not a file?", E_USER_ERROR); } // This needs to be moved. Preferably into the PHP package.