tridactyl/hooks/post-merge
Rummskartoffel a366cddf11 Update git hooks
Add check to pre-commit hook to skip on Windows, where it is currently
partially broken
Notify user when hooks are run to replace similar shared-git-hooks
functionality
2020-11-26 22:26:37 +01:00

16 lines
311 B
Bash
Executable file

#!/usr/bin/env bash
# stolen from https://gist.github.com/sindresorhus/7996717
echo "Running post-merge hook..."
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; then
yarn install
fi