added sync-npm-dependencies script and hooks
This commit is contained in:
parent
950872109e
commit
6576e4a74c
|
@ -35,7 +35,8 @@
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"pre-commit": "lint-staged",
|
"pre-commit": "lint-staged",
|
||||||
"pre-push": "npm test",
|
"pre-push": "npm test",
|
||||||
"post-merge": "npm install"
|
"post-merge": "scripts/sync-npm-dependencies.sh",
|
||||||
|
"post-checkout": "scripts/sync-npm-dependencies.sh"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "checking package-lock.json for changes"
|
||||||
|
if [ "$1" != "$2" ]; then
|
||||||
|
DIFF=$(git diff $1 $2 package-lock.json)
|
||||||
|
if [ "$DIFF" != "" ]; then
|
||||||
|
npm install
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Reference in New Issue