Commit a3c39918 authored by Simon Spannagel's avatar Simon Spannagel
Browse files

Git hook: take reference CMake file not from master but from the tagged version

parent abe2cf23
Pipeline #2287566 passed with stages
in 25 minutes and 48 seconds
......@@ -24,7 +24,10 @@ if [ -z "$TAGREF" ]; then
fi
# retrieve the version number from the VERSIONFILE
VERSION=$(git cat-file blob master:"$VERSIONFILE" | grep -m 1 'CORRYVRECKAN_VERSION' | sed 's/^[^"]*"//;s/"[^"]*$//')
VERSION=$(git cat-file blob "$TAGREF":"$VERSIONFILE" | grep -m 1 'CORRYVRECKAN_VERSION' | sed 's/^[^"]*"//;s/"[^"]*$//')
echo "Tag name: $TAGREF"
echo "Version: $VERSION (from file $VERSIONFILE)"
# The tag name matches the version number -- exit normally
if [ "$TAGREF" = "$VERSION" ]; then
......@@ -33,6 +36,4 @@ if [ "$TAGREF" = "$VERSION" ]; then
fi
echo "Tag name doesn't match version file. Preventing push."
echo "Tag name: $TAGREF"
echo "Version: $VERSION (from file $VERSIONFILE)"
exit 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment