Skip to content

Instantly share code, notes, and snippets.

@rdohms
Created November 9, 2015 21:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rdohms/8ea8f7d7ab75b4ea278e to your computer and use it in GitHub Desktop.
Save rdohms/8ea8f7d7ab75b4ea278e to your computer and use it in GitHub Desktop.
Auto-run Composer on branch checkout
# .git/hooks/post-checkout
#!/bin/bash
#
source ~/.profile
# Allows us to read user input below, assigns stdin to keyboard
exec < /dev/tty
while true; do
read -p "Run Composer install, Asset Dump and DB Migrations? [Y/n]: " yn
case $yn in
[Yy]* ) /usr/local/bin/php /usr/bin/composer install; /usr/local/bin/php app/console doctrine:migrations:migrate; gulp build; break;;
[Nn]* ) exit;;
* ) echo "Please answer yes or no.";;
esac
done%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment