Created
January 5, 2023 12:25
-
-
Save tadeubdev/4bd5e1e069fee26ad4a22514de22c340 to your computer and use it in GitHub Desktop.
post-receive
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
#!/usr/bin/env bash | |
# Verifique se houve alterações no arquivo package.json ou composer.json | |
while read oldrev newrev refname | |
do | |
if [[ $(git diff --name-only $oldrev $newrev | grep "package\.json$") != "" ]]; then | |
rm -rf node_modules | |
npm install --production | |
fi | |
if [[ $(git diff --name-only $oldrev $newrev | grep "composer\.json$") != "" ]]; then | |
rm -rf vendor | |
composer install --no-dev | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment