Skip to content

Commit

Permalink
fix bash lint
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacharrisholt committed Nov 21, 2024
1 parent c2ca455 commit 53ee03a
Showing 1 changed file with 35 additions and 28 deletions.
63 changes: 35 additions & 28 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}

0 comments on commit 53ee03a

Please sign in to comment.