summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2024-07-16 11:35:08 +0200
committerjaseg <git@jaseg.de>2024-07-16 11:35:08 +0200
commite460e3d1328f3e9e7d468da7901fe52f0fc7018a (patch)
treef6e1ccafe77ed278e044fb5484a03ad7e4d6c030
parent10b56bcdc25698de7898bcc090ab30757e33241d (diff)
downloadlolcat-e460e3d1328f3e9e7d468da7901fe52f0fc7018a.tar.gz
lolcat-e460e3d1328f3e9e7d468da7901fe52f0fc7018a.tar.bz2
lolcat-e460e3d1328f3e9e7d468da7901fe52f0fc7018a.zip
Add a little release script to keep the version numbers in sync
Fixes #58
-rwxr-xr-xdo_release.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/do_release.sh b/do_release.sh
new file mode 100755
index 0000000..4d437e8
--- /dev/null
+++ b/do_release.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+set -e
+
+if [ $# -lt 1 ]; then
+ echo "do_release.sh must be called with a version number as its first argument."
+ exit 1
+fi
+
+if [ -n "$(git status --porcelain|grep -v '^??')" ]; then
+ echo "do_release.sh must be called from a clean working directory."
+ exit 2
+fi
+
+VER="$1"
+
+if echo "$VER" | grep -v '^[0-9]\+\.[0-9]\+$'; then
+ echo "do_release.sh must be called with a version number formatted like "1.23" as its first argument, with no leading \"v\"."
+ exit 1
+fi
+
+echo "Updating files for version v$VER"
+
+sed -i "/L\"lolcat version [0-9.]\+, (c) [0-9]\+ jaseg\\\\n\"/s/version [0-9.]\+/version $VER/" lolcat.c
+sed -i "s/^pkgver=v[0-9.]\+/pkgver=v$VER/" PKGBUILD
+sed -i "/^AC_INIT/s/\[[0-9.]\+\]/[$VER]/" autotools/configure.ac
+git add lolcat.c PKGBUILD autotools/configure.ac
+git commit -m 'Bump version to v$VER'
+git tag "v$VER"
+echo "Success."
+