#!/bin/sh set -e -u ORG=zifeo REPO=whiz EXT=tar.gz NAME=whiz EXE=whiz INSTALLER_URL="https://raw.githubusercontent.com/$ORG/$REPO/main/installer.sh" RELEASE_URL="https://github.com/$ORG/$REPO/releases" LATEST_VERSION=$(curl "$RELEASE_URL/latest" -s -L -I -o /dev/null -w '%{url_effective}') LATEST_VERSION="${LATEST_VERSION##*v}" PLATFORM="${PLATFORM:-}" TMP_DIR=$(mktemp -d) OUT_DIR="${OUT_DIR:-/usr/local/bin}" VERSION="${VERSION:-$LATEST_VERSION}" MACHINE=$(uname -m) if [ "${PLATFORM:-x}" = "x" ]; then case "$(uname -s | tr '[:upper:]' '[:lower:]')" in "linux") case "$MACHINE" in "arm64"* | "aarch64"* ) PLATFORM='aarch64-unknown-linux-gnu' ;; *"64") PLATFORM='x86_64-unknown-linux-gnu' ;; esac ;; "darwin") case "$MACHINE" in "arm64"* | "aarch64"* ) PLATFORM='aarch64-apple-darwin' ;; *"64") PLATFORM='x86_64-apple-darwin' ;; esac ;; "msys"*|"cygwin"*|"mingw"*|*"_nt"*|"win"*) case "$MACHINE" in *"64") PLATFORM='x86_64-pc-windows-msvc' ;; esac ;; esac if [ "${PLATFORM:-x}" = "x" ]; then cat >&2 <&2 <