Created
February 22, 2013 07:54
-
-
Save drewdeponte/5011620 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" | |
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] | |
then | |
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id" | |
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] && | |
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true | |
if [[ $- == *i* ]] # check for interactive shells | |
then echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green | |
else echo "Using: $GEM_HOME" # don't use colors in non-interactive shells | |
fi | |
else | |
# If the environment file has not yet been created, use the RVM CLI to select. | |
rvm --create use "$environment_id" || { | |
echo "Failed to create RVM environment '${environment_id}'." | |
return 1 | |
} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment