Skip to content

Instantly share code, notes, and snippets.

@dragonmantank
Forked from rdohms/post-checkout
Created November 9, 2015 21:10
Show Gist options
  • Save dragonmantank/5825905db1dd18010152 to your computer and use it in GitHub Desktop.
Save dragonmantank/5825905db1dd18010152 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