Created
June 1, 2020 20:47
-
-
Save Kphillycat/c404fe448cc25a49f6b08ea99293f491 to your computer and use it in GitHub Desktop.
Git Hook for npm installs
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
if git diff-tree --name-only --no-commit-id ORIG_HEAD HEAD | grep --quiet 'package.json'; then | |
echo "$(date): Running npm install because package.json changed" | |
npm install > /dev/null | |
else | |
echo "$(date): No changes in package.json found" | |
fi | |
# ln -fv ./post-merge .git/hooks/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment