Skip to content

Instantly share code, notes, and snippets.

@snnwolf
Forked from yehosef/post-checkout
Created March 27, 2016 08:24
Show Gist options
  • Save snnwolf/9642da74e667abe24f76 to your computer and use it in GitHub Desktop.
Save snnwolf/9642da74e667abe24f76 to your computer and use it in GitHub Desktop.
git hook to update composer dependencies only if changed
#!/bin/bash
OLD=`md5 -q composer.lock.old`
NEW=`md5 -q composer.lock`
if [ "$NEW" != "$OLD" ]
then
rm -rf vendor
php composer.phar install
fi
cat composer.lock > composer.lock.old
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment