#!/usr/bin/env bash set -euo pipefail current_script_path=${BASH_SOURCE[0]} plugin_dir=$(dirname "$(dirname "$current_script_path")") # shellcheck source=../lib/utils.bash source "${plugin_dir}/lib/utils.bash" mkdir -p "$ASDF_DOWNLOAD_PATH" case $(uname -m) in x86_64) ARCH=amd64 ;; arm64|aarch64) ARCH=arm64 ;; arm) ARCH=arm ;; *) exit -1 ;; esac OS="$(uname -s | tr '[[:upper:]]' '[[:lower:]]')" case $OS in linux|darwin) ;; *) exit -1 ;; esac FILES=( "flux_${ASDF_INSTALL_VERSION}_${OS}_${ARCH}.tar.gz" ) for FILE in "${FILES[@]}"; do # Download tar.gz file to the download directory download_release "$ASDF_INSTALL_VERSION" "$FILE" # Extract contents of tar.gz file into the download directory tar -xzf "$FILE" -C "$ASDF_DOWNLOAD_PATH" || fail "Could not extract $FILE" chmod +x "${ASDF_DOWNLOAD_PATH}/flux" # Remove the tar.gz file since we don't need to keep it rm "$FILE" done