#!/bin/sh # curl -fsSL https://junderdo.dev/loopherd/install.sh | sh # # Runs the latest loopherd release's install.sh, which does the installing. # LOOPHERD_VERSION=vX.Y.Z pins a release. set -eu url=https://github.com/junderdo/loopherd/releases/latest/download/install.sh fail() { echo "loopherd: $*" >&2 exit 1 } download() { if command -v curl >/dev/null 2>&1; then curl -fsSL -o "$1" "$url" elif command -v wget >/dev/null 2>&1; then wget -q -O "$1" "$url" else fail "needs curl or wget to download $url" fi } # One function, so `sh` reads the whole script before running any of it. main() { installer=$(mktemp) trap 'rm -f "$installer"' EXIT download "$installer" || fail "could not download $url" # Under `curl | sh` stdin is this script, not the reader. sh "$installer"