Created
January 10, 2014 17:41
-
-
Save benrogmans/8358914 to your computer and use it in GitHub Desktop.
Git hook for composer
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/bash | |
PREV_COMMIT=$1 | |
POST_COMMIT=$2 | |
NOCOLOR='\e[0m' | |
REDCOLOR='\e[37;41m' | |
if [[ -f composer.lock ]]; then | |
DIFF=`git diff --shortstat $PREV_COMMIT..$POST_COMMIT composer.lock` | |
if [[ $DIFF != "" ]]; then | |
php composer.phar install | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment