Skip to content

Instantly share code, notes, and snippets.

@oirodolfo
Forked from bgallagh3r/post-recieve
Created June 20, 2016 18:55
Show Gist options
  • Save oirodolfo/fdc9691783a6343867b3065e9471fef9 to your computer and use it in GitHub Desktop.
Save oirodolfo/fdc9691783a6343867b3065e9471fef9 to your computer and use it in GitHub Desktop.
Make git run composer install/update after you push to remote server.
#!/bin/bash
DIR=$(git rev-parse --show-toplevel)
if [ -e "$DIR/composer.json" ]; then
if [ -d "$DIR/vendor" ]; then
composer install
else
composer update
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment