Skip to content

Instantly share code, notes, and snippets.

@jasonrhodes
Created September 20, 2012 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jasonrhodes/3757112 to your computer and use it in GitHub Desktop.
Save jasonrhodes/3757112 to your computer and use it in GitHub Desktop.
Checks for changes in composer.json and alerts to update in a post-merge hook
#!/bin/sh
#
# To enable this hook, rename this file to "post-merge".
# We could probably run composer update here, but this is safer for now
if git diff --name-only HEAD^1 | grep composer.json >/dev/null
then
echo ' '
echo '#############################################################################'
echo 'Changes made to the composer.json file'
echo ' '
echo 'You might need to run "$ php composer.phar update" to get new packages'
echo 'Changes made:'
git diff HEAD^1 composer.json
echo '#############################################################################'
echo ' '
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment