Created
January 9, 2021 00:04
-
-
Save stctheproducer/8ce7ecff2930d014dc6eeeba417b2239 to your computer and use it in GitHub Desktop.
A pre-commit hook that bumps the version of the project
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/sh | |
# Go to git root | |
path=`git rev-parse --show-toplevel` | |
cd "$path" | |
version=`docker run --rm -v "$(pwd):/repo" gittools/gitversion:5.6.3-alpine.3.12-x64-5.0 /repo /showvariable SemVer` | |
echo $version > VERSION | |
exitCode=0 | |
json -I -f package.json -e 'this.version="'$version'"' | |
git add . | |
exit $exitCode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment