Skip to content

Commit

Permalink
Fix dir parsing bug in install script
Browse files Browse the repository at this point in the history
Fixes #152.
  • Loading branch information
marlonrichert committed Dec 18, 2021
1 parent cbbb63d commit f79a8c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ emulate zsh
[[ -z $dir ]] &&
continue

if ! err=$( dir=${${(e)~dir}:a} 2>&1 ); then
print -ru2 -- "${(%):-%9F}${err#'(anon):'<->\: }%f"
if ! err=$( ( : ${${(e)~dir}:a} ) 2>&1 ); then
print -Pru2 -- "%F{9}${err#'(anon):'<->\: }%f"
dir=
elif [[ ! -e $dir ]]; then
elif dir=${${(e)~dir}:a} && [[ ! -e $dir ]]; then
if read -q ${(%):-"?%fNo such dir %F{12}${(D)dir}%f. Create? [yn] "}; then
zf_mkdir -pm 0700 - $dir ||
dir=
Expand All @@ -38,7 +38,7 @@ emulate zsh
fi
print
elif [[ ! -d $dir ]]; then
print -u2 - "${(%):-%9F}${(D)dir}is not a directory.%f"
print -Pru2 - "%F{9}${(D)dir}is not a directory.%f"
dir=
fi
done
Expand Down

0 comments on commit f79a8c5

Please sign in to comment.