mkdir fix

This commit is contained in:
accel 2022-01-12 00:06:48 +03:00
parent 54c6df3fd4
commit 56ca0556f1

View File

@ -34,24 +34,24 @@ function zshlibs_boot()
function zshlibs_ensure() function zshlibs_ensure()
{ {
target=${2} target="${2}"
typ=${1} typ="${1}"
if ! test -e ${target} if ! test -e "${target}"
then then
zshlibs_log zshlibs_ensure "creating '${target}' ($typ) …" zshlibs_log zshlibs_ensure "creating '${target}' ($typ) …"
case $typ in case $typ in
-d) -d)
mkdir -p ${target} \ mkdir -p "${target}" \
|| zshlibs_log $0 "unable to create directory '${target}'" \ || zshlibs_log $0 "unable to create directory '${target}'" \
&& return 2 && return 2
;; ;;
-f) -f)
touch ${target} \ touch "${target}" \
|| zshlibs_log $0 "unable to create file '${target}'" \ || zshlibs_log $0 "unable to create file '${target}'" \
&& return 2 && return 2
esac esac
zshlibs_log zshlibs_ensure "target '${target}' created" zshlibs_log zshlibs_ensure "target '${target}' created"
elif test ${typ} ${target} elif test "${typ}" "${target}"
then then
zshlibs_log zshlibs_ensure "target '${target}' ($typ) present" zshlibs_log zshlibs_ensure "target '${target}' ($typ) present"
return 0 return 0