Created
March 2, 2019 06:06
-
-
Save radavis/f5118eebd67b3cb2e664be2b9ac97303 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
git diff --name-only --cached | grep -q package-lock.json | |
pkglock_staged=$? | |
git diff --name-only --cached | grep -q package.json | |
pkgjson_staged=$? | |
if [[ "$pkglock_staged" -eq 0 && "$pkgjson_staged" -eq 1 ]]; then | |
echo "attempted commit of package-lock.json without changes to package.json!" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment