Created
August 25, 2014 09:14
-
-
Save kovagoz/47392c54c891c34407e6 to your computer and use it in GitHub Desktop.
Composer install on git checkout
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
#!/bin/bash | |
old_head="$1" | |
new_head="$2" | |
branch_switch="$3" | |
git_root=$(git rev-parse --show-toplevel) | |
git diff --name-only $new_head $old_head | grep composer.lock > /dev/null | |
if [ $? -eq 0 ] && [ $branch_switch -eq 1 ]; then | |
php $git_root/composer.phar install | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment