We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a84d22 commit 509da5cCopy full SHA for 509da5c
tagger.sh
@@ -0,0 +1,20 @@
1
+#!/bin/bash
2
+set -e
3
+set -u
4
+#set -x
5
+
6
+# extract AC_INIT package and version
7
+PACKAGE=$(sed -nr "/^AC_INIT\b/{ s/^[^(]*\([ ]*([^, ]+).*/\1/; s/\[|]//g; p; }" configure.ac)
8
+echo PACKAGE="$PACKAGE"
9
10
+VERSION=$(sed -nr "/^AC_INIT\b/{ s/^[^,]*,[^0-9]*([0-9.]*).*/\1/; p; }" configure.ac)
11
+[[ $VERSION =~ ^[0-9.]+$ ]] || die "failed to detect package version"
12
+echo VERSION="$VERSION"
13
14
+if git show-ref --tags --quiet --verify -- "refs/tags/$VERSION"
15
+then
16
+echo "tag $VERSION already exists"
17
+exit 1
18
+else
19
+git tag "$VERSION"
20
+fi
0 commit comments