Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Composer install on git checkout
#!/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
You can’t perform that action at this time.