Skip to content

Commit

Permalink
chore(husky): limit the possibility of package installation after a b…
Browse files Browse the repository at this point in the history
…ranch switch
  • Loading branch information
SimonGolms committed Sep 2, 2022
1 parent 4e702c1 commit 25e199f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
. "$(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
# Install any missing dependencies since package.json changed, while only versions changes are ignored.
git diff-tree -r --ignore-matching-lines="version" --name-only --no-commit-id "$1" "$2" | grep --quiet package.json && npm ci
set -e
4 changes: 2 additions & 2 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# Install any missing dependencies since package.json changed
git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD | grep --quiet package.json && npm install
# Install any missing dependencies since package.json changed, while only versions changes are ignored.
git diff-tree -r --ignore-matching-lines="version" --name-only --no-commit-id ORIG_HEAD HEAD | grep --quiet package.json && npm ci

0 comments on commit 25e199f

Please sign in to comment.