Skip to content

Commit ad54e2a

Browse files
committed
fix release script
1 parent 3b2c18d commit ad54e2a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

script/release

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
1313
echo -e "The latest release tag is: ${BLUE}${latest_tag}${OFF}"
1414
read -p 'New Release Tag (vX.X.X format): ' new_tag
1515

16-
tag_regex='^v\d\.\d\.\d$'
17-
echo "$new_tag" | grep -P -q $tag_regex
16+
tag_regex='^v[0-9]+\.[0-9]+\.[0-9]+$'
17+
echo "$new_tag" | grep -E "$tag_regex"
1818

1919
if [[ $? -ne 0 ]]; then
20-
echo "Tag: $new_tag is valid"
20+
echo -e "${RED}ERROR${OFF} - Tag: $new_tag is not valid. Please use vX.X.X format."
21+
exit 1
2122
fi
2223

2324
git tag -a $new_tag -m "$new_tag Release"

0 commit comments

Comments
 (0)