From 53ee03a2f71d85626be9a1bf0c8cfa44cca3892b Mon Sep 17 00:00:00 2001 From: Isaac Harris-Holt Date: Thu, 21 Nov 2024 15:12:09 +0000 Subject: [PATCH] fix bash lint --- lib/utils.bash | 63 ++++++++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/lib/utils.bash b/lib/utils.bash index d014740..11d324f 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -73,44 +73,51 @@ install_version() { # under the MIT License. Thank you! # Copyright (c) 2024 Gerard Hickey get_arch() { - uname -m | tr '[:upper:]' '[:lower:]' + uname -m | tr '[:upper:]' '[:lower:]' } get_platform() { - uname | tr '[:upper:]' '[:lower:]' + uname | tr '[:upper:]' '[:lower:]' } get_release_nugget() { - local nugget - - case $(get_arch)-$(get_platform) in - arm64-darwin) - nugget='x86_64-apple-darwin' ;; - x86_64-darwin) - nugget='x86_64-apple-darwin' ;; - # arm*-linux) - # nugget='arm-unknown-linux-gnu' ;; - x86_64-linux) - nugget='x86_64-unknown-linux-musl' ;; - # i[3456]86-linux) - # nugget='i686-unknown-linux-musl' ;; - x86_64-windows) - nugget='x86_64-pc-windows-gnu' ;; - # i[3456]-windows) - # nugget='i686-pc-windows-msvc' ;; - *) - nugget="$(get_arch)-$(get_platform)" - esac - - echo "${nugget}" + local nugget + + case $(get_arch)-$(get_platform) in + arm64-darwin) + nugget='x86_64-apple-darwin' + ;; + x86_64-darwin) + nugget='x86_64-apple-darwin' + ;; + # arm*-linux) + # nugget='arm-unknown-linux-gnu' ;; + x86_64-linux) + nugget='x86_64-unknown-linux-musl' + ;; + # i[3456]86-linux) + # nugget='i686-unknown-linux-musl' ;; + x86_64-windows) + nugget='x86_64-pc-windows-gnu' + ;; + # i[3456]-windows) + # nugget='i686-pc-windows-msvc' ;; + *) + nugget="$(get_arch)-$(get_platform)" + ;; + esac + + echo "${nugget}" } get_archive_name() { - local version="$1" - echo "jetted-${version}-$(get_release_nugget).tar.gz" + local version="$1" + echo "jetted-${version}-$(get_release_nugget).tar.gz" } get_download_url() { - local version="$1" - echo "$GH_REPO/releases/download/v${version}/${get_archive_name $version}" + local version="$1" + local archive_name + archive_name="$(get_archive_name "$version")" + echo "$GH_REPO/releases/download/v${version}/${archive_name}" }