Better immunity to setopt nofunctionargzero

This commit is contained in:
Sebastian Gniazdowski 2016-06-10 05:17:46 +02:00
parent 5a435d3d83
commit 4af4fe9b84

View file

@ -4,11 +4,7 @@
# to ~/.zshrc.
#
# This gives immunity to functionargzero being unset
# _ will be set to last argument to source builtin
PLUGIN_UNDERSCORE="$_"
[ "$0" != "$PLUGIN_UNDERSCORE" ] && 0="$PLUGIN_UNDERSCORE"
0="${(%):-%N}" # this gives immunity to functionargzero being unset
REPO_DIR="${0%/*}"
if [[ -z "$ZPLG_CUR_PLUGIN" && "${fpath[(r)$REPO_DIR]}" != $REPO_DIR ]]; then
fpath+=( "$REPO_DIR" )