Skip to content

Commit

Permalink
update url
Browse files Browse the repository at this point in the history
  • Loading branch information
MontakOleg committed Jan 27, 2024
1 parent ef4c037 commit 3330052
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

0 comments on commit 3330052

Please sign in to comment.