From bfae8fcd11ad7e15715ebde0aead5cb3fb296711 Mon Sep 17 00:00:00 2001 From: yan Date: Mon, 23 Apr 2012 10:32:36 -0700 Subject: [PATCH] Moved rvm configuration to separate zsh snippet to keep zshrc clean --- zsh/rvm.zsh | 17 +++++++++++++++++ zsh/zshrc | 19 ------------------- 2 files changed, 17 insertions(+), 19 deletions(-) create mode 100644 zsh/rvm.zsh diff --git a/zsh/rvm.zsh b/zsh/rvm.zsh new file mode 100644 index 0000000..7a160a1 --- /dev/null +++ b/zsh/rvm.zsh @@ -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 diff --git a/zsh/zshrc b/zsh/zshrc index 7658366..63f213d 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -33,24 +33,6 @@ fi # Configuration 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 # ================== @@ -63,4 +45,3 @@ fi if [[ -a ~/.secrets ]] then source ~/.secrets fi -