Created
May 28, 2020 16:31
-
-
Save imjakechapman/738ba69e5987ffe729f6926e15fd22be to your computer and use it in GitHub Desktop.
Automatically npm install when package.json has changed when git pull
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
#/usr/bin/env bash | |
changed="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check() { | |
echo "$changed" | grep --quiet "$1" && eval "$2" | |
} | |
check package.json "npm install" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment