Created
December 18, 2017 11:27
-
-
Save coderabbi/201cd84a7c273d535be9511fb9055238 to your computer and use it in GitHub Desktop.
'composer install' git post-merge hook
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
# .git/hooks/post-merge | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
composer_install_on_changed_lockfile() { | |
echo "$changed_files" | grep --quiet "composer.lock" && | |
echo "Changes to 'composer.lock' detected; running 'composer install'." && | |
composer install | |
} | |
composer_install_on_changed_lockfile | |
exit 0; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment