Created
February 25, 2018 02:44
-
-
Save abdumu/1f67dcb956e02e68a8e46a251ef0b3d9 to your computer and use it in GitHub Desktop.
git hook (.git/hooks/.post-merge) to run a command after `git pull` for laravel by @Abdu1M
This file contains 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
## | |
# git hook to run a command after `git pull` for laravel by @abdu1m | |
## | |
# source: https://gist.github.com/sindresorhus/7996717 | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" | |
} | |
# npm | |
check_run package.json "npm install" | |
# composer | |
check_run composer.json "composer install" | |
#fixes and updates | |
npm run dev | |
composer dumpautoload | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment