#!/bin/sh # Install the cronpup command-line helper: curl -fsSL https://cronpup.com/install.sh | sh # Puts one POSIX sh script (https://cronpup.com/static/cronpup, readable before you run it) into /usr/local/bin if you can # write there, otherwise ~/.local/bin. Set PREFIX=/some/dir to choose. Nothing else is changed. set -eu SRC="${CRONPUP_URL:-https://cronpup.com}/static/cronpup" if [ -n "${PREFIX:-}" ]; then DIR=$PREFIX elif [ -w /usr/local/bin ]; then DIR=/usr/local/bin else DIR="$HOME/.local/bin"; fi mkdir -p "$DIR" TMP=$(mktemp) trap 'rm -f "$TMP"' EXIT curl -fsSL "$SRC" -o "$TMP" head -1 "$TMP" | grep -q '^#!/bin/sh' || { echo "download didn't look like the cronpup script; nothing installed" >&2; exit 1; } chmod 755 "$TMP" mv "$TMP" "$DIR/cronpup" trap - EXIT echo "installed $DIR/cronpup ($("$DIR/cronpup" version))" case ":$PATH:" in *":$DIR:"*) ;; *) echo "note: $DIR is not on your PATH; add it, or call $DIR/cronpup directly" ;; esac echo "try: cronpup run -- echo hello"