Last active
June 22, 2016 14:02
-
-
Save sitereactor/2fc0825eed9337f4f3e2af49c948e0ff to your computer and use it in GitHub Desktop.
post-checkout hook for changing an appsetting in web.config upon checkout
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 hook parameters | |
prevHEAD=$1 | |
newHEAD=$2 | |
checkoutType=$3 | |
if [ $checkoutType -eq 1 ] | |
then | |
#Set variable with name of Branch | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
#Create the branch folder if it doesn't exist | |
mkdir -p "app_data/courier/branch" | |
#Remove the umbraco.config file when switching branches | |
rm -f app_data/umbraco.config | |
#Remove files in the branch folder | |
rm -rf app_data/courier/branch/* | |
#Write current branch name to the branch folder | |
echo '' > app_data/courier/branch/$BRANCH | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment