From 06dd9e7d44c72990c9582d3ff64e12c140dfc371 Mon Sep 17 00:00:00 2001 From: kwxm Date: Wed, 5 Jun 2024 17:34:47 +0100 Subject: [PATCH] More error checking --- scripts/update-version.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/update-version.sh b/scripts/update-version.sh index 15b3cbe12f1..975afe5ad30 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -19,6 +19,12 @@ VERSION=$2 IFS='.' read -r -a components <<< "$VERSION" +if [[ ${#components[@]} < 2 ]]; then + echo "Too few components in version number" $VERSION "(need at least two)" + usage + exit 1 +fi + major_version="${components[0]}.${components[1]}" echo "Updating version of $PACKAGE to $VERSION"