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
| #/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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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"