Skip to content

Instantly share code, notes, and snippets.

@dragonmantank
Forked from rdohms/post-checkout
Created November 9, 2015 21:10
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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