From ee74647d326848959e485583e0a293f4f199e950 Mon Sep 17 00:00:00 2001 From: Kenneth MacKenzie Date: Wed, 5 Jun 2024 17:49:12 +0100 Subject: [PATCH] More error checking (#6179) --- 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"