-
-
Save woodsleaf/a756578e16487f33413187f595192a5f to your computer and use it in GitHub Desktop.
Make git run composer install/update after you push to remote server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DIR=$(git rev-parse --show-toplevel) | |
| if [ -e "$DIR/composer.json" ]; then | |
| if [ -d "$DIR/vendor" ]; then | |
| composer.phar install | |
| else | |
| composer.phar update | |
| fi | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
touch .git/hooks/post-receive
cat < .git/hooks/post-receive
#!/bin/sh
cd ..
GIT_DIR='.git'
if [ -e "composer.json" ]; then
if [ -d "vendor" ]; then
composer install
else
composer update
fi
fi
git reset --hard
EOF
chmod +x .git/hooks/post-receive