aboutsummaryrefslogtreecommitdiffstats
path: root/global-functions
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2022-12-13 10:31:41 +0100
committerGravatar Christian Hesse <mail@eworm.de>2022-12-13 10:31:41 +0100
commit446d5c89fcc4f1fba7f8339e0ead23ba5720be5e (patch)
tree7d22adc17bb1b6820ec3f1e03ba40367e29d743d /global-functions
parent9c42263988e6c1615d348832a92c091c3414aa08 (diff)
global-functions: $MkDir: fail if non-directory path exists
Diffstat (limited to 'global-functions')
-rw-r--r--global-functions5
1 files changed, 5 insertions, 0 deletions
diff --git a/global-functions b/global-functions
index 75a7dda..71d711b 100644
--- a/global-functions
+++ b/global-functions
@@ -536,6 +536,11 @@
:return true;
}
+ :if ([ :len [ /file/find where name=$Dir ] ] = 1) do={
+ $LogPrintExit2 warning $0 ("The path '" . $Dir . "' exists, but is not a directory.") false;
+ :return false;
+ }
+
:local Return true;
:local Name ($Dir . "-" . [ $GetRandom20CharAlNum 6 ]);
:do {