Skip to content

Commit

Permalink
chore(husky): add git hook post-checkout
Browse files Browse the repository at this point in the history
- switching between branches installs any missing dependencies since package.json changed
  • Loading branch information
SimonGolms committed Aug 25, 2022
1 parent c307714 commit 188b1f1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

set +e
# Install any missing dependencies since package.json changed
git diff-tree -r --name-only --no-commit-id "$1" "$2" | grep --quiet package.json && npm ci
set -e

0 comments on commit 188b1f1

Please sign in to comment.