#!/bin/sh set -e -u ORG=zifeo REPO=lade EXT=tar.gz NAME=lade EXE=lade 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 ldd --version 2>&1 | grep -q musl; then LIBC="musl" else LIBC="gnu" fi if [ "${PLATFORM:-x}" = "x" ]; then case "$(uname -s | tr '[:upper:]' '[:lower:]')" in "linux") case "$MACHINE" in "arm64"* | "aarch64"*) if [ "$LIBC" = "musl" ]; then PLATFORM='aarch64-unknown-linux-musl' else PLATFORM='aarch64-unknown-linux-gnu' fi ;; *"64") if [ "$LIBC" = "musl" ]; then PLATFORM='x86_64-unknown-linux-musl' else PLATFORM='x86_64-unknown-linux-gnu' fi ;; 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 <