Skip to content

Commit

Permalink
Fix some linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sarg3nt committed May 25, 2024
1 parent 60fb7a0 commit 47f7c19
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion bin/download
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ mkdir -p "$ASDF_DOWNLOAD_PATH"
release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME-$ASDF_INSTALL_VERSION"

# Download tar.gz file to the download directory
download_release "$ASDF_INSTALL_VERSION" "$release_file"
download_release "$ASDF_INSTALL_VERSION"
43 changes: 21 additions & 22 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -37,37 +37,37 @@ get_platform() {
platform=''
machine=$(uname -m)
case "$(uname -s | tr '[:upper:]' '[:lower:]')" in
"linux")
"linux")
case "$machine" in
"arm64"* | "aarch64"* ) platform='linux-arm64' ;;
"arm"* | "aarch"*) platform='linux-arm' ;;
*"86") platform='linux32' ;;
*"64") platform='linux64' ;;
"arm64"* | "aarch64"* ) platform='linux-arm64' ;;
"arm"* | "aarch"*) platform='linux-arm' ;;
*"86") platform='linux32' ;;
*"64") platform='linux64' ;;
esac
;;
"darwin") platform='osx' ;;
*"freebsd"*)
"darwin") platform='osx' ;;
*"freebsd"*)
case "$machine" in
*"86") platform='freebsd32' ;;
*"64") platform='freebsd64' ;;
*"86") platform='freebsd32' ;;
*"64") platform='freebsd64' ;;
esac
;;
"openbsd")
"openbsd")
case "$machine" in
*"86") platform='openbsd32' ;;
*"64") platform='openbsd64' ;;
*"86") platform='openbsd32' ;;
*"64") platform='openbsd64' ;;
esac
;;
"netbsd")
"netbsd")
case "$machine" in
*"86") platform='netbsd32' ;;
*"64") platform='netbsd64' ;;
*"86") platform='netbsd32' ;;
*"64") platform='netbsd64' ;;
esac
;;
"msys"*|"cygwin"*|"mingw"*|*"_nt"*|"win"*)
"msys"*|"cygwin"*|"mingw"*|*"_nt"*|"win"*)
case "$machine" in
*"86") platform='win32' ;;
*"64") platform='win64' ;;
*"86") platform='win32' ;;
*"64") platform='win64' ;;
esac
;;
esac
Expand All @@ -87,12 +87,11 @@ get_platform() {
download_release() {
local version filename url platform extension
version="$1"
filename="$2"
platform=$(get_platform)
if [ "${platform:-x}" = "win64" ] || [ "${platform:-x}" = "win32" ]; then
extension='zip'
else
extension='tar.gz'
extension='tar.gz'
fi

echo "Platform: $platform"
Expand All @@ -105,12 +104,12 @@ download_release() {
curl "${curl_opts[@]}" -o "$download_file" -C - "$url" || fail "Could not download $url"

case "$extension" in
"zip") unzip -j "$download_file" -d "$ASDF_DOWNLOAD_PATH/" ;;
"zip") unzip -j "$download_file" -d "$ASDF_DOWNLOAD_PATH/" ;;
"tar.gz") tar -xvzf "$download_file" -C "$ASDF_DOWNLOAD_PATH/" --strip-components=1 "micro-$version/micro" ;;
esac

rm "$download_file"
echo "* Downlaod complte"
echo "* Downlaod complete"
}

install_version() {
Expand Down

0 comments on commit 47f7c19

Please sign in to comment.