Skip to content

Instantly share code, notes, and snippets.

@mattscilipoti
Forked from flarik/dot.powrc.sh
Last active January 18, 2021 22:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattscilipoti/25178ad883b226e995a0140914b691d8 to your computer and use it in GitHub Desktop.
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)
#!/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