Created
December 13, 2013 15:56
-
-
Save olimortimer/7946395 to your computer and use it in GitHub Desktop.
Git Hooks
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/bash | |
# Post checkout runs during branch switching | |
# Used to copy over a branch specific config.js file | |
branch="$(git rev-parse --abbrev-ref HEAD)" | |
config='mobile/assets/js/config.js' | |
# Check if our file exists | |
if [ -e $config-$branch ] | |
then | |
echo "config.js-$branch > config.js" | |
cp $config-$branch $config | |
# Else, use our live config file | |
else | |
echo "config.js-live > config.js" | |
cp $config-live $config | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment