Created
September 13, 2011 10:16
-
-
Save asymmetric/1213537 to your computer and use it in GitHub Desktop.
Git post commit hook to change RVM 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 | |
source "$HOME/.rvm/scripts/rvm" | |
git_rev() { | |
ref=$(git symbolic-ref HEAD 2>/dev/null) || return | |
echo ${ref#refs/heads/} | |
} | |
ref=$(git_rev) | |
case $ref in | |
master) | |
gemset=jobs | |
;; | |
dev) | |
gemset=jobs31 | |
;; | |
esac | |
echo "switching to gemset $gemset" | |
rvm gemset use $gemset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment