zexists is broken

This commit is contained in:
Daylin Morgan 2023-02-28 12:08:46 -06:00
parent 753b56d1e9
commit 26445dcc83
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -15,7 +15,6 @@ function source-zshcmdd {
echo >&2 "zexists: dir not found '${ZSHCMDD:-${ZDOTDIR:-$HOME}/zexists.d/cmd}'" echo >&2 "zexists: dir not found '${ZSHCMDD:-${ZDOTDIR:-$HOME}/zexists.d/cmd}'"
return 1 return 1
fi fi
local -a conf_files=("$zshcmdd[1]"/*.{sh,zsh}(N)) local -a conf_files=("$zshcmdd[1]"/*.{sh,zsh}(N))
local rcfile local rcfile
local antircfile local antircfile
@ -33,7 +32,6 @@ function source-zshcmdd {
fi fi
done done
} }
source-zshcmdd
function zshdir-decode { function zshdir-decode {
# for now just remove the 'dir' part # for now just remove the 'dir' part
@ -88,15 +86,18 @@ function source-zshpathd {
directory=$HOME/$(zshdir-decode ${name}) directory=$HOME/$(zshdir-decode ${name})
# source files only if exe with that name exists # source files only if exe with that name exists
if [[ -d $directory ]]; then if [[ -d $directory ]]; then
# echo "$directory"
source $rcfile source $rcfile
else else
# if it doesn't exist try the anti version # TODO: antirc naming broken
antircfile=${rcfile:h}/anti-${pathtype}-${rcfile:t} # # if it doesn't exist try the anti version
[[ -f $antircfile ]] && source $antircfile # antircfile="${rcfile:h}/anti-${pathtype}-${rcfile:t}"
# [[ -f $antircfile ]] && source $antircfile
fi fi
done done
} }
source-zshpathd source-zshcmdd || echo >&2 'issues loading zexists.d/cmd'
source-zshpathd || echo >&2 'issues loading zexists.d/path'
unset _envsubst