#!/bin/sh # stipend installer — https://stipend.sh # # This is a wrapper. The installer itself is install.py, and it is the same one # on every platform: macOS, Linux, Windows. Three separate installers drift # apart, and the one nobody tests is the one an agent runs. # # It fetches one Python package, unpacks it, and writes a launcher. It does not # create a wallet, touch any key, or send anything anywhere. Read it first: # # curl -sL https://stipend.sh/install.py # set -eu URL="${STIPEND_INSTALLER:-https://stipend.sh/install.py}" # python3 on most systems, python where that is the only name — some minimal # images ship one and not the other. PY="" for candidate in python3 python; do if command -v "$candidate" >/dev/null 2>&1; then if "$candidate" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 8) else 1)' 2>/dev/null; then PY="$candidate" break fi fi done if [ -z "$PY" ]; then echo "stipend: python 3.8 or newer is required." >&2 echo "" >&2 echo " Debian/Ubuntu: sudo apt install python3" >&2 echo " macOS: brew install python3" >&2 echo " Alpine: apk add python3" >&2 exit 1 fi # A pipe, not a temporary file: nothing is left on disk if this is interrupted, # and there is no file for anything else to race us for. if command -v curl >/dev/null 2>&1; then curl -fsSL "$URL" | "$PY" - elif command -v wget >/dev/null 2>&1; then wget -qO- "$URL" | "$PY" - else echo "stipend: curl or wget is required." >&2 exit 1 fi