Created
August 21, 2018 12:34
-
-
Save flesch/d9d40fa2d96ddda26e64900c87b942d7 to your computer and use it in GitHub Desktop.
Git pre-commit hook to ensure the version in package.json has changed
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
#!/bin/bash | |
set -o nounset | |
if [ "$(git status -s | wc -l | bc)" -gt "0" ]; then | |
if [ "$(git diff --cached master -G '"version":' | wc -l | bc)" -eq "0" ]; then | |
echo -e "\033[31m✘\033[0m Aborting commit! \"package.json\" was not updated with a new version." | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment