Created
September 17, 2015 03:04
-
-
Save ianaya89/040734b1587bb17eb390 to your computer and use it in GitHub Desktop.
Git hook that will install npm dependecies (if package.json changed) after a git pull.
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
#!/bin/sh | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" | |
} | |
check_run package.json "npm install" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment