-
-
Save mattscilipoti/25178ad883b226e995a0140914b691d8 to your computer and use it in GitHub Desktop.
Pow's .powenv config file for use with RVM's config files .rvmrc or .ruby-version (+ optional .ruby-gemset)
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
#!/usr/bin/env bash | |
if [ -f "${rvm_path}/scripts/rvm" ]; then | |
source "${rvm_path}/scripts/rvm" | |
# use the config files | |
# .rvmrc supersedes all others | |
if [ -f ".rvmrc" ]; then | |
source ".rvmrc" | |
elif [ -f ".ruby-version" ]; then | |
environment_id=`cat .ruby-version` | |
if [ -f ".ruby-gemset" ]; then | |
environment_id=`cat .ruby-version`@`cat .ruby-gemset` | |
fi | |
rvm use "$environment_id" || { | |
echo "Failed to open RVM environment '${environment_id}'." | |
return 1 | |
} | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment