mirror of
https://github.com/dcarrillo/prezto.git
synced 2025-10-14 11:09:08 +00:00
Return 1 when a file fails to load
This commit is contained in:
6
init.zsh
6
init.zsh
@@ -53,8 +53,6 @@ autoload -Uz zmv
|
||||
|
||||
# Source plugins defined in ~/.zshrc.
|
||||
for plugin in "$plugins[@]"; do
|
||||
zstyle ":omz:plugin:$plugin" enable 'yes'
|
||||
|
||||
if [[ ! -d "${0:h}/plugins/$plugin" ]]; then
|
||||
print "omz: no such plugin: $plugin" >&2
|
||||
fi
|
||||
@@ -62,6 +60,10 @@ for plugin in "$plugins[@]"; do
|
||||
if [[ -f "${0:h}/plugins/$plugin/init.zsh" ]]; then
|
||||
source "${0:h}/plugins/$plugin/init.zsh"
|
||||
fi
|
||||
|
||||
if (( $? == 0 )); then
|
||||
zstyle ":omz:plugin:$plugin" enable 'yes'
|
||||
fi
|
||||
done
|
||||
unset plugin plugins
|
||||
|
||||
|
Reference in New Issue
Block a user