Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Auto-run Composer on branch checkout
# .git/hooks/post-checkout
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.";;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment