fixed git hooks
This commit is contained in:
parent
6576e4a74c
commit
9ad9c9feb2
2 changed files with 7 additions and 3 deletions
|
@ -35,7 +35,7 @@
|
|||
"hooks": {
|
||||
"pre-commit": "lint-staged",
|
||||
"pre-push": "npm test",
|
||||
"post-merge": "scripts/sync-npm-dependencies.sh",
|
||||
"post-merge": "npm install",
|
||||
"post-checkout": "scripts/sync-npm-dependencies.sh"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
echo "checking package-lock.json for changes"
|
||||
if [ "$1" != "$2" ]; then
|
||||
DIFF=$(git diff $1 $2 package-lock.json)
|
||||
IFS=' '
|
||||
read -ra G_PARAMS <<< "$HUSKY_GIT_PARAMS"
|
||||
PREV=${G_PARAMS[0]}
|
||||
NEXT=${G_PARAMS[1]}
|
||||
if [ "$PREV" != "$NEXT" ]; then
|
||||
DIFF=$(git diff $PREV $NEXT package-lock.json)
|
||||
if [ "$DIFF" != "" ]; then
|
||||
npm install
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue