Created
December 25, 2014 14:15
-
-
Save sattellite/d427b646e7928f3c00f0 to your computer and use it in GitHub Desktop.
Git pre-commit hook for versioning
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
#!/usr/bin/zsh | |
VERFILE=lib/Data.pm | |
if (git diff --cached --diff-filter=M --unified=0 $VERFILE|grep VERSION 1>/dev/null) | |
then | |
exit 0 | |
else | |
cat <<\EOF | |
WARNING: Version of the project has not been updated. | |
This project is using Semantic Versioning. | |
Information about versioning you can found at http://semver.org/ | |
EOF | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment