From 1b7e2433060960eab05e25faa2c9cf1ff69b8cfa Mon Sep 17 00:00:00 2001 From: Piotr Idzik <65706193+vil02@users.noreply.github.com> Date: Mon, 8 Jul 2024 13:29:50 +0200 Subject: [PATCH] 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 * fix: hande versions like `1.6.x` or `2.x` * style: make diff smaller --------- Co-authored-by: jiro --- install_nim.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install_nim.sh b/install_nim.sh index 16081cbe..cfecf5dd 100755 --- a/install_nim.sh +++ b/install_nim.sh @@ -74,13 +74,15 @@ if [[ "$nim_version" = "devel" ]]; then exit fi -# fetch latest tag if 'nim_version' was 'stable' +# get exact version of stable if [[ "$nim_version" = "stable" ]]; then - # NOTE: jq is pre-installed on github actions runner - nim_version="$(fetch_tags | latest_version)" -elif [[ "$nim_version" =~ ^[0-9]+\.[0-9]+\.x$ ]] || [[ "$nim_version" =~ ^[0-9]+\.x$ ]]; then + nim_version=$(curl -sSL https://nim-lang.org/channels/stable) +fi + +if [[ "$nim_version" =~ ^[0-9]+\.[0-9]+\.x$ ]] || [[ "$nim_version" =~ ^[0-9]+\.x$ ]]; then nim_version="$(fetch_tags | grep -E "$(tag_regexp "$nim_version")" | latest_version)" fi + info "install nim $nim_version" # download nim compiler