diff --git a/bin/download b/bin/download index b815439..ba88181 100755 --- a/bin/download +++ b/bin/download @@ -10,8 +10,10 @@ source "${plugin_dir}/lib/utils.bash" mkdir -p "$ASDF_DOWNLOAD_PATH" +release_file="$ASDF_DOWNLOAD_PATH/dt.tgz" + # Download tar.gz file to the download directory -download_release "$ASDF_INSTALL_VERSION" +download_release "$ASDF_INSTALL_VERSION" "$release_file" # Extract contents of tar.gz file into the download directory tar -xzf "$release_file" -C "$ASDF_DOWNLOAD_PATH" || fail "Could not extract $release_file" diff --git a/lib/utils.bash b/lib/utils.bash index 853882a..d82073c 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -50,9 +50,9 @@ host_zig_triple() { download_release() { local version filename url version="$1" + filename="$2" url="$GH_REPO/releases/download/v${version}/dt-$(host_zig_triple).tgz" - filename="$ASDF_DOWNLOAD_PATH/dt" echo "* Downloading $TOOL_NAME release $version (to $filename)" curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url"