Add helper function for sourcing files if present

This commit is contained in:
crater2150 2019-07-08 16:11:28 +02:00
parent 9bcef048c7
commit 98a86e6b70

11
zshrc
View file

@ -24,11 +24,16 @@ zdotfile() {
echo /etc/zsh/$1
fi
}
try-source() {
for i in "$@"; do
if [[ -e "$i" ]]; then
source $i
fi
done
}
local dirfile=$(zdotfile dirs)
if [[ -e $dirfile ]]; then
source $dirfile
fi
try-source $dirfile
. $(zdotfile completion.zsh)
source $(zdotfile zplug.zsh)