forked from ryanb/nifty-generators
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
simplifying .rvmrc
- Loading branch information
Showing
1 changed file
with
1 addition
and
23 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1 @@ | ||
#!/usr/bin/env bash | ||
|
||
# adapted from: http://rvm.beginrescueend.com/workflow/rvmrc/ | ||
|
||
ruby_string="1.9.2" | ||
gemset_name="nifty-generators" | ||
|
||
if rvm list strings | grep -q "${ruby_string}" ; then | ||
|
||
# Load or create the specified environment | ||
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \ | ||
&& -s "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" ]] ; then | ||
\. "${rvm_path:-$HOME/.rvm}/environments/${ruby_string}@${gemset_name}" | ||
else | ||
rvm --create "${ruby_string}@${gemset_name}" | ||
fi | ||
|
||
else | ||
|
||
# Notify the user to install the desired interpreter before proceeding. | ||
echo "${ruby_string} was not found, please run 'rvm install ${ruby_string}' and then cd back into the project directory." | ||
|
||
fi | ||
rvm use 1.9.2@nifty-generators --create |