Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Trying to fix install
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanratcliffe committed Sep 28, 2024
1 parent b54e8fa commit 95ecd34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
23 changes: 12 additions & 11 deletions bin/download
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ set -euo pipefail
# Determine the platform and architecture dynamically
platform="$(uname)"
case "${platform}" in
"Linux") platform="Linux" ;;
"Darwin") platform="Darwin" ;;
*) fail "Unsupported platform: ${platform}" ;;
"Linux") platform="Linux" ;;
"Darwin") platform="Darwin" ;;
*) fail "Unsupported platform: ${platform}" ;;
esac

architecture="$(uname -m)"
case "${architecture}" in
"x86_64") architecture="x86_64" ;;
"arm64" | "aarch64") architecture="arm64" ;;
"i386") architecture="i386" ;;
*) fail "Unsupported architecture: ${architecture}" ;;
"x86_64") architecture="x86_64" ;;
"arm64"|"aarch64") architecture="arm64" ;;
"i386") architecture="i386" ;;
*) fail "Unsupported architecture: ${architecture}" ;;
esac

current_script_path=${BASH_SOURCE[0]}
Expand All @@ -27,13 +27,14 @@ source "${plugin_dir}/lib/utils.bash"
mkdir -p "$ASDF_DOWNLOAD_PATH"

# Set the release file based on the dynamic platform, architecture, and version.
release_file="$ASDF_DOWNLOAD_PATH/${TOOL_NAME}_${ASDF_INSTALL_VERSION}_${platform}_${architecture}.tar.gz"
release_file="overmind_cli_${ASDF_INSTALL_VERSION}_${platform}_${architecture}.tar.gz"
download_path="$ASDF_DOWNLOAD_PATH/$release_file"

# Download tar.gz file to the download directory
download_release "$ASDF_INSTALL_VERSION" "$release_file"
download_release "$ASDF_INSTALL_VERSION" "$release_file" "$download_path"

# Extract contents of tar.gz file into the download directory
tar -xzf "$release_file" -C "$ASDF_DOWNLOAD_PATH" --strip-components=1 || fail "Could not extract $release_file"
tar -xzf "$download_path" -C "$ASDF_DOWNLOAD_PATH" --strip-components=1 || fail "Could not extract $download_path"

# Remove the tar.gz file since we don't need to keep it
rm "$release_file"
rm "$download_path"
5 changes: 3 additions & 2 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,16 @@ list_all_versions() {
}

download_release() {
local version filename url
local version filename download_path url
version="$1"
filename="$2"
download_path="$3"

# Construct the dynamic URL based on the provided version, platform, and architecture.
url="$GH_REPO/releases/download/v${version}/${filename}"

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

install_version() {
Expand Down

0 comments on commit 95ecd34

Please sign in to comment.