Skip to content

Instantly share code, notes, and snippets.

@mtibben
Created February 14, 2013 01:20
Show Gist options
  • Save mtibben/4949919 to your computer and use it in GitHub Desktop.
Save mtibben/4949919 to your computer and use it in GitHub Desktop.
Hook to tell you when to run a composer install. Put this in your .git/hooks/post-checkout
#!/usr/bin/env bash
file="composer.lock"
if [[ $(git diff HEAD@{1}..HEAD@{0} -- "${file}" | wc -l) -gt 0 ]]; then
echo
echo -e "======> \033[33m${file}\033[0m has changed! Execute \033[32mcomposer install --dev\033[0m"
echo
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment