Skip to content

Instantly share code, notes, and snippets.

@benrogmans
Created January 10, 2014 17:41
Show Gist options
  • Save benrogmans/8358914 to your computer and use it in GitHub Desktop.
Save benrogmans/8358914 to your computer and use it in GitHub Desktop.
Git hook for composer
#!/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