Last active
January 5, 2025 08:52
-
-
Save Powell-v2/a06be9e59c50ab32b6255977787a25b7 to your computer and use it in GitHub Desktop.
Install any missing deps after merging in updates from remote.
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
# capture info messages and any errors in a log file | |
exec >> log/hooks-out.log 2>&1 | |
if git diff-tree --name-only --no-commit-id ORIG_HEAD HEAD | grep -q 'package.json'; then | |
echo "$(date): reinstalling deps since package.json changed" | |
yarn > /dev/null | |
else | |
echo "$(date): no changes detected in package.json" | |
fi | |
# link is needed: ln -fv [script location] .git/hooks/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment