tridactyl/hooks/post-merge
2017-11-24 11:12:42 +00:00

14 lines
309 B
Bash
Executable file

#!/usr/bin/env bash
# stolen from https://gist.github.com/sindresorhus/7996717
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
file_changed() {
echo "$changed_files" | grep --quiet "$1"
}
if file_changed package.json || file_changed package-lock.json; then
npm install
fi