Skip to content

Commit

Permalink
fix(download): remove version from remote filename
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
sid-maddy committed Apr 2, 2022
1 parent 97a3a40 commit 4c7f592
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,18 @@ list_all_versions() {
}

download_release() {
local version filename url platform
version="$1"
filename="$2"
platform="$(get_platform)"
if [ "$platform" == "darwin" ]; then
local version="$1"
local filename="$2"
local platform="$(get_platform)"
if [ "${platform}" == "darwin" ]; then
platform="macos"
fi

url="$GH_REPO/releases/download/v$version/stylua-$version-$platform.zip"
local remote_filename="stylua-${platform}.zip"
if [[ ${version} < "0.13.0" ]]; then
remote_filename="stylua-${version}-${platform}.zip"
fi
local url="$GH_REPO/releases/download/v${version}/${remote_filename}"

echo "* Downloading $TOOL_NAME release $version..."
curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url"
Expand Down

0 comments on commit 4c7f592

Please sign in to comment.