Skip to content

Commit 1b7e243

Browse files
vil02jiro4989
andauthored
fix: get exact version of stable (#497)
* fix: get exact version of `stable` * style: remove old code resolving `stable` version * style: use `https` Co-authored-by: jiro <jiroron666@gmail.com> * fix: hande versions like `1.6.x` or `2.x` * style: make diff smaller --------- Co-authored-by: jiro <jiroron666@gmail.com>
1 parent 9bf991d commit 1b7e243

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

install_nim.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,15 @@ if [[ "$nim_version" = "devel" ]]; then
7474
exit
7575
fi
7676

77-
# fetch latest tag if 'nim_version' was 'stable'
77+
# get exact version of stable
7878
if [[ "$nim_version" = "stable" ]]; then
79-
# NOTE: jq is pre-installed on github actions runner
80-
nim_version="$(fetch_tags | latest_version)"
81-
elif [[ "$nim_version" =~ ^[0-9]+\.[0-9]+\.x$ ]] || [[ "$nim_version" =~ ^[0-9]+\.x$ ]]; then
79+
nim_version=$(curl -sSL https://nim-lang.org/channels/stable)
80+
fi
81+
82+
if [[ "$nim_version" =~ ^[0-9]+\.[0-9]+\.x$ ]] || [[ "$nim_version" =~ ^[0-9]+\.x$ ]]; then
8283
nim_version="$(fetch_tags | grep -E "$(tag_regexp "$nim_version")" | latest_version)"
8384
fi
85+
8486
info "install nim $nim_version"
8587

8688
# download nim compiler

0 commit comments

Comments
 (0)