Add helper function for sourcing files if present
This commit is contained in:
parent
9bcef048c7
commit
98a86e6b70
11
zshrc
11
zshrc
|
@ -24,11 +24,16 @@ zdotfile() {
|
||||||
echo /etc/zsh/$1
|
echo /etc/zsh/$1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
try-source() {
|
||||||
|
for i in "$@"; do
|
||||||
|
if [[ -e "$i" ]]; then
|
||||||
|
source $i
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
local dirfile=$(zdotfile dirs)
|
local dirfile=$(zdotfile dirs)
|
||||||
if [[ -e $dirfile ]]; then
|
try-source $dirfile
|
||||||
source $dirfile
|
|
||||||
fi
|
|
||||||
|
|
||||||
. $(zdotfile completion.zsh)
|
. $(zdotfile completion.zsh)
|
||||||
source $(zdotfile zplug.zsh)
|
source $(zdotfile zplug.zsh)
|
||||||
|
|
Loading…
Reference in a new issue