File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 14
14
15
15
# COLORS
16
16
OFF=' \033[0m'
17
- # RED='\033[0;31m'
17
+ RED=' \033[0;31m'
18
18
GREEN=' \033[0;32m'
19
19
BLUE=' \033[0;34m'
20
20
@@ -27,16 +27,17 @@ if [[ -z "$latest_tag" ]]; then
27
27
fi
28
28
29
29
echo -e " The latest release tag is: ${BLUE}${latest_tag}${OFF} "
30
- read -p ' New Release Tag (vX.X.X format): ' new_tag
31
-
32
- tag_regex=' ^v\d\.\d\.\d$'
33
- echo " $new_tag " | grep -P -q $tag_regex
34
-
35
- if [[ $? -ne 0 ]]; then
36
- echo " Tag: $new_tag is valid"
30
+ read -r -p ' New Release Tag (vX.X.X format): ' new_tag
31
+
32
+ tag_regex=' v[0-9]+\.[0-9]+\.[0-9]+$'
33
+ if echo " $new_tag " | grep -q -E " $tag_regex " ; then
34
+ echo -e " Tag: ${BLUE} $new_tag ${OFF} is valid"
35
+ else
36
+ echo -e " Tag: ${BLUE} $new_tag ${OFF} is ${RED} not valid${OFF} (must be in vX.X.X format)"
37
+ exit 1
37
38
fi
38
39
39
- git tag -a $new_tag -m " $new_tag Release"
40
+ git tag -a " $new_tag " -m " $new_tag Release"
40
41
41
42
echo -e " ${GREEN} OK${OFF} - Tagged: $new_tag "
42
43
You can’t perform that action at this time.
0 commit comments