From 446d5c89fcc4f1fba7f8339e0ead23ba5720be5e Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 13 Dec 2022 10:31:41 +0100 Subject: global-functions: $MkDir: fail if non-directory path exists --- global-functions | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'global-functions') 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 { -- cgit v1.2.3-54-g00ecf