Created
May 7, 2010 18:53
-
-
Save ColinHarrington/393855 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
GIT_BRANCH=`git branch 2>/dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
GRAILS_SCRIPT=$GRAILS_HOME/bin/grails | |
if [ $GIT_BRANCH ]; then | |
GRAILS_WORK_DIR=`echo ~`/.grails_$GIT_BRANCH`` | |
echo "** grails working directory: $GRAILS_WORK_DIR" | |
$GRAILS_SCRIPT -Dgrails.work.dir=$GRAILS_WORK_DIR $@ | |
else | |
echo "** default grails working directory" | |
$GRAILS_SCRIPT $@ | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Adapted from Ted Naleid's hg version
http://naleid.com/blog/2010/05/07/using-a-unique-grails-working-directory-for-each-mercurial-branch/