-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(husky): limit the possibility of package installation after a b…
…ranch switch - add git hook `post-checkout`
- Loading branch information
1 parent
4a71214
commit 256af00
Showing
2 changed files
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/usr/bin/env 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 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 ORIG_HEAD HEAD | grep --quiet package.json && npm ci |