Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for versions greater than 2.5 #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ list_all_versions() {
list_github_tags
}


download_release() {
local version filename url
version="$1"
Expand Down Expand Up @@ -74,16 +75,19 @@ download_release() {
# exemple https://github.com/scaleway/scaleway-cli/releases/download/v2.2.0/scw-2-2-0-darwin-x86_64
# exemple 2 https://github.com/scaleway/scaleway-cli/releases/download/v2.2.1/scw-2.2.1-linux-x86_64
# exemple 3 https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_darwin_arm64
# exemple 4 https://github.com/scaleway/scaleway-cli/releases/download/v2.5.1/scaleway-cli_2.5.1_darwin_amd64
# exemple scw-2-2-0-darwin-x86_64
url1="$GH_REPO/releases/download/v${version}/scw-${version_slug_1}-${target_os}-${target_arch}${target_ext}"
url2="$GH_REPO/releases/download/v${version}/scw-${version_slug_2}-${target_os}-${target_arch}${target_ext}"
url3="$GH_REPO/releases/download/v${version}/scaleway-cli_${version_slug_2}_${target_os}_${target_arch}${target_ext}"
url4="$GH_REPO/releases/download/v${version}/scaleway-cli_${version_slug_2}_${target_os}_amd64${target_ext}"

echo "* Downloading scaleway-cli release $version..."
curl -fs "${curl_opts[@]}" -o "$filename" -C - "$url1" ||
curl -fs "${curl_opts[@]}" -o "$filename" -C - "$url2" ||
curl -fs "${curl_opts[@]}" -o "$filename" -C - "$url3" ||
fail "Could not download $url1 or $url2" or $url3
curl -fs "${curl_opts[@]}" -o "$filename" -C - "$url4" ||
fail "Could not download $url1 or $url2 or $url3 or $url4"
}

install_version() {
Expand Down