Skip to content

Commit

Permalink
Add directory creation back to render.php with the same output as in …
Browse files Browse the repository at this point in the history
…Options Handler (#124)

Co-authored-by: haszi <haszika80@gmail.com>
  • Loading branch information
haszi and haszi authored May 10, 2024
1 parent 891340a commit 415ff43
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion render.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 415ff43

Please sign in to comment.