Return 1 when a file fails to load

This commit is contained in:
Sorin Ionescu 2012-03-28 12:19:53 -04:00
parent 37b140d1d3
commit 647ac1ac00
6 changed files with 10 additions and 8 deletions

View file

@ -8,7 +8,7 @@
# Dumb terminals lack support. # Dumb terminals lack support.
if [[ "$TERM" == 'dumb' ]]; then if [[ "$TERM" == 'dumb' ]]; then
return return 1
fi fi
setopt COMPLETE_IN_WORD # Complete from both ends of a word. setopt COMPLETE_IN_WORD # Complete from both ends of a word.

View file

@ -53,8 +53,6 @@ autoload -Uz zmv
# Source plugins defined in ~/.zshrc. # Source plugins defined in ~/.zshrc.
for plugin in "$plugins[@]"; do for plugin in "$plugins[@]"; do
zstyle ":omz:plugin:$plugin" enable 'yes'
if [[ ! -d "${0:h}/plugins/$plugin" ]]; then if [[ ! -d "${0:h}/plugins/$plugin" ]]; then
print "omz: no such plugin: $plugin" >&2 print "omz: no such plugin: $plugin" >&2
fi fi
@ -62,6 +60,10 @@ for plugin in "$plugins[@]"; do
if [[ -f "${0:h}/plugins/$plugin/init.zsh" ]]; then if [[ -f "${0:h}/plugins/$plugin/init.zsh" ]]; then
source "${0:h}/plugins/$plugin/init.zsh" source "${0:h}/plugins/$plugin/init.zsh"
fi fi
if (( $? == 0 )); then
zstyle ":omz:plugin:$plugin" enable 'yes'
fi
done done
unset plugin plugins unset plugin plugins

View file

@ -7,7 +7,7 @@
# Dumb terminals lack support. # Dumb terminals lack support.
if [[ "$TERM" == 'dumb' ]]; then if [[ "$TERM" == 'dumb' ]]; then
return return 1
fi fi
# The default styles. # The default styles.
@ -65,7 +65,7 @@ keyinfo=(
for key in "$keyinfo[@]"; do for key in "$keyinfo[@]"; do
if [[ -z "$key" ]]; then if [[ -z "$key" ]]; then
print "omz: one or more keys are non-bindable" >&2 print "omz: one or more keys are non-bindable" >&2
return return 1
fi fi
done done

View file

@ -7,7 +7,7 @@
# #
if (( ! $+commands[gpg-agent] )); then if (( ! $+commands[gpg-agent] )); then
return return 1
fi fi
_gpg_env="$HOME/.gnupg/gpg-agent.env" _gpg_env="$HOME/.gnupg/gpg-agent.env"

View file

@ -21,7 +21,7 @@
# #
if (( ! $+commands[ssh-agent] )); then if (( ! $+commands[ssh-agent] )); then
return return 1
fi fi
_ssh_agent_env="${HOME}/.ssh/environment-${HOST}" _ssh_agent_env="${HOME}/.ssh/environment-${HOST}"

View file

@ -8,7 +8,7 @@
# Dumb terminals lack support. # Dumb terminals lack support.
if [[ "$TERM" == 'dumb' ]]; then if [[ "$TERM" == 'dumb' ]]; then
return return 1
fi fi
# Set the GNU Screen window number. # Set the GNU Screen window number.