@@ -29,16 +29,16 @@ find_version_from_git_tags() {
29
29
local repository=$2
30
30
local prefix=${3:- " tags/v" }
31
31
local separator=${4:- " ." }
32
- local last_part_optional=${5:- " false " }
32
+ local last_part_optional=${5:- " " }
33
33
if [ " $( echo " ${requested_version} " | grep -o " ." | wc -l) " != " 2" ]; then
34
34
local escaped_separator=${separator// ./ \\ .}
35
35
local last_part
36
- if [ " ${last_part_optional} " != " false " ]; then
37
- last_part=" ( ${escaped_separator} [0-9]+)* .*${last_part_optional} "
36
+ if [ -n " ${last_part_optional} " ]; then
37
+ last_part=" .*${last_part_optional} "
38
38
else
39
- last_part=" ${escaped_separator} [0-9]+ "
39
+ last_part=" "
40
40
fi
41
- local regex=" ${prefix} \\ K[0-9]+${escaped_separator} [0-9]+${last_part} $"
41
+ local regex=" ${prefix} \\ K[0-9]+${escaped_separator} [0-9]+${escaped_separator} [0-9]+ ${ last_part} $"
42
42
local version_list
43
43
check_git
44
44
check_packages ca-certificates
@@ -75,7 +75,7 @@ if [ "${CHANNEL}" = "main" ]; then
75
75
URL=" https://storage.googleapis.com/dart-archive/channels/be/raw/latest/sdk/dartsdk-linux-${SDK_ARCH} -release.zip"
76
76
else
77
77
if [ " ${CHANNEL} " = " stable" ]; then
78
- LAST_PART=" false "
78
+ LAST_PART=" "
79
79
elif [ " ${CHANNEL} " = " beta" ]; then
80
80
LAST_PART=" beta"
81
81
elif [ " ${CHANNEL} " = " dev" ]; then
85
85
exit 1
86
86
fi
87
87
# Soft version matching
88
- find_version_from_git_tags VERSION " https://github.com/dart-lang/sdk" " tags/v " " ." " ${LAST_PART} "
88
+ find_version_from_git_tags VERSION " https://github.com/dart-lang/sdk" " tags/" " ." " ${LAST_PART} "
89
89
90
90
URL=" https://storage.googleapis.com/dart-archive/channels/${CHANNEL} /release/${VERSION} /sdk/dartsdk-linux-${SDK_ARCH} -release.zip"
91
91
fi
0 commit comments