Use install to create directories for modules

This commit is contained in:
Rezart Qelibari
2022-04-19 05:43:22 +02:00
parent 203cef9bf6
commit a6b1759302
4 changed files with 12 additions and 9 deletions

View File

@@ -27,6 +27,14 @@ function getModuleAnswerByKeyRegEx() {
return 1
}
function ensurePathOrLogError() {
local dir=$1 msg=$2
[[ -d ${dir} ]] || install -m $(umask -S) -d $(getMissingPaths ${dir}) || {
lop -- -e "$msg" -e "Directory ${dir} does not exist and could not be created."
return 10
}
}
function checkCommands() {
local cmd
for cmd in ${(k)cmds}; do