Created
October 22, 2010 16:11
-
-
Save bru/640835 to your computer and use it in GitHub Desktop.
switches rails environment in passenger based on the git branch
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 | |
ref=$(git symbolic-ref HEAD 2> /dev/null) | |
if [[ -n $ref ]]; then | |
if [[ $ref =~ "master" ]]; then | |
rm public/.htaccess | |
else | |
echo "RailsEnv ${ref#refs/heads/}" > public/.htaccess | |
fi | |
touch tmp/restart.txt | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment