global-functions: $MkDir: fail if non-directory path exists

This commit is contained in:
Christian Hesse 2022-12-13 10:31:41 +01:00
parent 9c42263988
commit 446d5c89fc

View file

@ -536,6 +536,11 @@
:return true; :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 Return true;
:local Name ($Dir . "-" . [ $GetRandom20CharAlNum 6 ]); :local Name ($Dir . "-" . [ $GetRandom20CharAlNum 6 ]);
:do { :do {