Last active
August 29, 2015 14:04
-
-
Save ifthenelse/f2e1b3bff2bd2b8c110e to your computer and use it in GitHub Desktop.
A hook script to switch between parameters files when checking out different branches of the same Symfony2 repo
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 | |
# | |
# A hook script to switch between parameters files when checking out different branches of the same Symfony2 repo | |
# | |
# To enable this hook, rename this file to "post-checkout". | |
PREVIOUS_HEAD=$1 | |
NEW_HEAD=$2 | |
BRANCH_SWITCH=$3 | |
if [ $BRANCH_SWITCH == "1" -a $PREVIOUS_HEAD != $NEW_HEAD ]; then | |
NEW_HEAD_NAME=`git rev-parse --abbrev-ref HEAD` | |
# Start from the repository root. | |
cd ./$(git rev-parse --show-cdup) | |
if [ $NEW_HEAD_NAME == "develop" -o $NEW_HEAD_NAME == "master" -o $NEW_HEAD_NAME == "feature/on-air-upcoming-show" ]; then | |
rm app/config/parameters.yml | |
cp app/config/parameters_guidatv.yml app/config/parameters.yml | |
else | |
rm app/config/parameters.yml | |
cp app/config/parameters_pilota.yml app/config/parameters.yml | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment