sync-npm-dependencies.sh 282 B

12345678910111213
  1. #!/bin/bash
  2. echo "checking package-lock.json for changes"
  3. IFS=' '
  4. read -ra G_PARAMS <<< "$HUSKY_GIT_PARAMS"
  5. PREV=${G_PARAMS[0]}
  6. NEXT=${G_PARAMS[1]}
  7. if [ "$PREV" != "$NEXT" ]; then
  8. DIFF=$(git diff $PREV $NEXT package-lock.json)
  9. if [ "$DIFF" != "" ]; then
  10. npm install
  11. fi
  12. fi