commit 380f6c9b46283cf927bc84f7fafd1e0eda230cb5
parent 6deb4ff40bb1681f879fdb86b291e50c7aeaae0b
Author: Michael Weiss <dev.primeos@gmail.com>
Date: Thu, 16 Jul 2020 13:39:39 +0200
contrib/_incr_version: Disallow the "v"-prefixed version format
The check is a bit strange but should be POSIX compliant.
Diffstat:
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/contrib/_incr_version b/contrib/_incr_version
@@ -1,6 +1,13 @@
#!/bin/sh -eu
old_version="$1"
new_version="$2"
+
+if [ "$new_version" != "${new_version#v}" ]
+then
+ echo "Error: The new version shouldn't be prefixed with a \"v\"." >&2
+ exit 1
+fi
+
sed -i meson.build -e "s/^ version: .*#release_version/ version: '$new_version', #release_version/g"
printf "Minimum wlroots version? "