Skip to content

Commit

Permalink
Merge pull request #1 from abatilo/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie authored Oct 1, 2023
2 parents 4b01e4d + 9501922 commit d07a448
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,27 @@ install_version() {
)
}

# Implementation taken from
# https://stackoverflow.com/a/4024263
verlte() {
[ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ]
}

verlt() {
[ "$1" = "$2" ] && return 1 || verlte $1 $2
}

get_tarball_name() {
local version="$1"
local os="$(uname -s | tr '[:upper:]' '[:lower:]')"
local arch="$(uname -m)"

if [[ "$os" == "darwin" ]]; then
os="macOS"
# depot/cli PR #150 changed the release naming convention
# https://github.com/depot/cli/pull/150
if verlt "$version" "2.21.2"; then
os="macOS"
fi
fi

if [[ "$arch" == "arm64" ]] || [[ "$arch" == "aarch64" ]]; then
Expand Down

0 comments on commit d07a448

Please sign in to comment.