Last active
August 29, 2015 14:11
-
-
Save jrafanie/0163a705d7129e1d560f to your computer and use it in GitHub Desktop.
post-checkout
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
#!/bin/sh | |
# | |
# Put this in manageiq/.git/hooks/post-checkout | |
# Make sure you chmod +x !!! | |
# | |
# Swap a Rails 4 Gemfile.lock on checkout of rails4 branch | |
# Put back the master branch Gemfile.lock when checking out a non-"rails4" branch. | |
# | |
branch=$(git symbolic-ref -q --short HEAD) | |
if [ "$branch" = "rails4" ] | |
then | |
if [ -f $PWD/vmdb/Gemfile.lock.rails4 ] | |
then | |
mv $PWD/vmdb/Gemfile.lock $PWD/vmdb/Gemfile.lock.master | |
mv $PWD/vmdb/Gemfile.lock.rails4 $PWD/vmdb/Gemfile.lock | |
fi | |
else | |
if [ -f $PWD/vmdb/Gemfile.lock.master ] | |
then | |
mv $PWD/vmdb/Gemfile.lock $PWD/vmdb/Gemfile.lock.rails4 | |
mv $PWD/vmdb/Gemfile.lock.master $PWD/vmdb/Gemfile.lock | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In case it helps(?), here's the one I use on rails/rails: https://gist.github.com/matthewd/14ab543c126a4390646e