Skip to content

Instantly share code, notes, and snippets.

@allgood2386
Created December 30, 2015 14:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save allgood2386/7209e40b334d722e3f90 to your computer and use it in GitHub Desktop.
#/usr/bin/env bash
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#
feature_revert() {
cd ./docroot
echo 'Do you want to revert your local features? [y/n]'
read doRevert;
if [ $doRevert == "y" ]
then
echo 'Reverting features on local environment'
drush @vagrant fra;
exit 0
fi
if [ $doRevert == "n" ]
then
echo 'Features remain unchanged'
exit 0
fi
echo 'Incorrect useage. Please answer with "y" or "n"'
exit 1
}
feature_revert;
@allgood2386
Copy link
Author

7 files changed, 96 insertions(+), 17 deletions(-)
Do you want to revert your local features? [y/n]
.git/hooks/post-merge: line 11: [: ==: unary operator expected
.git/hooks/post-merge: line 17: [: ==: unary operator expected
Incorrect useage. Please answer with "y" or "n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment