From 333005260a3654ebe705f347708b0e4f5e37dd19 Mon Sep 17 00:00:00 2001 From: Oleg Montak Date: Sat, 27 Jan 2024 11:07:49 +0200 Subject: [PATCH] update url --- lib/utils.bash | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/utils.bash b/lib/utils.bash index 79236ab..19eac3d 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -37,12 +37,13 @@ list_all_versions() { } download_release() { - local version filename url + local version filename url platform version="$1" filename="$2" + platform=$(get_platform) # TODO: Adapt the release URL convention for mockolo - url="$GH_REPO/archive/v${version}.tar.gz" + url="$GH_REPO/releases/download/${version}/mockolo.${platform}.tar.gz" echo "* Downloading $TOOL_NAME release $version..." curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url" @@ -72,3 +73,13 @@ install_version() { fail "An error occurred while installing $TOOL_NAME $version." ) } + +get_platform() { + local -r platform="$(uname -s)" + + if [[ $platform == "Linux" ]]; then + echo "ubuntu" + else + echo "macos" + fi +}