Moved rvm configuration to separate zsh snippet to keep zshrc clean

This commit is contained in:
yan 2012-04-23 10:32:36 -07:00
parent fa1aa24105
commit bfae8fcd11
2 changed files with 17 additions and 19 deletions

17
zsh/rvm.zsh Normal file
View File

@ -0,0 +1,17 @@
# RVM / rbenv
if [[ -d ~/.rvm/ ]] && [[ -d ~/.rbenv/ ]]; then
# TODO: colorize
echo '***************************************************************'
echo 'ERROR!'
echo 'YADR found both ~/.rvm and ~/.rbenv directories. You cannot use'
echo 'RVM and rbenv simultaneously. Please delete one and reload zsh.'
echo '***************************************************************'
echo ''
else
if [[ -d ~/.rvm/ ]]; then
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
fi
if [[ -d ~/.rbenv/ ]]; then
eval "$(rbenv init -)"
fi
fi

View File

@ -33,24 +33,6 @@ fi
# Configuration # Configuration
for config_file ($yadr/zsh/*.zsh) source $config_file for config_file ($yadr/zsh/*.zsh) source $config_file
# RVM / rbenv
if [[ -d ~/.rvm/ ]] && [[ -d ~/.rbenv/ ]]; then
# TODO: colorize
echo '***************************************************************'
echo 'ERROR!'
echo 'YADR found both ~/.rvm and ~/.rbenv directories. You cannot use'
echo 'RVM and rbenv simultaneously. Please delete one and reload zsh.'
echo '***************************************************************'
echo ''
else
if [[ -d ~/.rvm/ ]]; then
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
fi
if [[ -d ~/.rbenv/ ]]; then
eval "$(rbenv init -)"
fi
fi
# ------------------ # ------------------
# zsh/after # zsh/after
# ================== # ==================
@ -63,4 +45,3 @@ fi
if [[ -a ~/.secrets ]] then if [[ -a ~/.secrets ]] then
source ~/.secrets source ~/.secrets
fi fi