Check version number is of the correct format

This commit is contained in:
Gwilym Kuiper 2021-06-20 23:07:47 +01:00
parent 9924fb9aa1
commit ba58d3bf27

View file

@ -13,8 +13,8 @@ if [ "$VERSION" = "" ]; then
fi
# Check the format of version
if [ ! "$(echo "$VERSION" | grep -E "[0-9]+\.[0-9]+\.[0-9]+")" ]; then
echo "Version must be of the form x.y.z"
if [ ! "$(echo "$VERSION" | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$")" ]; then
echo "Version must be of the form x.y.z, got $VERSION"
exit 1
fi