fix formatting for release script

Signed-off-by: Brian DeHamer <bdehamer@github.com>
This commit is contained in:
Brian DeHamer 2024-02-23 16:56:27 -08:00
parent 4c5a33ee04
commit 0dcaa8ed2b
No known key found for this signature in database

View File

@ -28,9 +28,9 @@ BLUE='\033[0;34m'
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)") latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
if [[ -z "$latest_tag" ]]; then if [[ -z "$latest_tag" ]]; then
# There are no existing release tags # There are no existing release tags
echo -e "No tags found (yet) - Continue to create and push your first tag" echo -e "No tags found (yet) - Continue to create and push your first tag"
latest_tag="[unknown]" latest_tag="[unknown]"
fi fi
# Display the latest release tag # Display the latest release tag
@ -42,11 +42,11 @@ read -r -p 'Enter a new release tag (vX.X.X format): ' new_tag
# Validate the new release tag # Validate the new release tag
tag_regex='v[0-9]+\.[0-9]+\.[0-9]+$' tag_regex='v[0-9]+\.[0-9]+\.[0-9]+$'
if echo "$new_tag" | grep -q -E "$tag_regex"; then if echo "$new_tag" | grep -q -E "$tag_regex"; then
echo -e "Tag: ${BLUE}$new_tag${OFF} is valid" echo -e "Tag: ${BLUE}$new_tag${OFF} is valid"
else else
# Release tag is not `vX.X.X` format # Release tag is not `vX.X.X` format
echo -e "Tag: ${BLUE}$new_tag${OFF} is ${RED}not valid${OFF} (must be in vX.X.X format)" echo -e "Tag: ${BLUE}$new_tag${OFF} is ${RED}not valid${OFF} (must be in vX.X.X format)"
exit 1 exit 1
fi fi
# Tag the new release # Tag the new release