tridactyl/hooks/post-checkout

17 lines
305 B
Text
Raw Normal View History

#!/usr/bin/env bash
# stolen from https://gist.github.com/sindresorhus/7996717
echo "Running post-checkout hook..."
changed_files="$(git diff-tree -r --name-only --no-commit-id $1 $2)"
file_changed() {
echo "$changed_files" | grep --quiet "$1"
}
if file_changed package.json; then
2019-05-31 16:48:53 +01:00
yarn install
fi