move `tag_regex` to variables section

This commit is contained in:
Paul Ebose 2024-07-01 02:17:03 +01:00
parent 36ccc40bdc
commit 67934fecc6
No known key found for this signature in database
GPG Key ID: 2FF647AADFAC0FE8

View File

@ -18,6 +18,9 @@
#
# script/release
# Variables
tag_regex='v[0-9]+\.[0-9]+\.[0-9]+$'
# Terminal colors
OFF='\033[0m'
RED='\033[0;31m'
@ -40,7 +43,6 @@ echo -e "The latest release tag is: ${BLUE}${latest_tag}${OFF}"
read -r -p 'Enter a new release tag (vX.X.X format): ' new_tag
# Validate the new release tag
tag_regex='v[0-9]+\.[0-9]+\.[0-9]+$'
if echo "$new_tag" | grep -q -E "$tag_regex"; then
echo -e "Tag: ${BLUE}$new_tag${OFF} is valid"
else