#!/bin/sh # Bootstrap installer for maestro. Builds the `maestro-installer` crate into a # scratch dir, runs the wizard, and cleans up — leaving only the unified # `maestro` binary in `~/.cargo/bin`. # # Usage: # curl -sSf https://git.naps.pt/naps62/maestro/raw/branch/main/install.sh | sh # # Pass flags through to the wizard with `sh -s --`: # curl -sSf <...>/install.sh | sh -s -- --yes --no-systemd # # Re-run any time to update — `cargo install` overwrites the existing binary. set -eu REPO_URL=${MAESTRO_REPO_URL:-https://git.naps.pt/naps62/maestro} REPO_BRANCH=${MAESTRO_REPO_BRANCH:-} if ! command -v cargo >/dev/null 2>&1; then echo "maestro install: \`cargo\` not found on PATH." >&2 echo "Install Rust first: https://rustup.rs" >&2 exit 1 fi tmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t maestro-install) trap 'rm -rf "$tmpdir"' EXIT INT TERM echo "==> building maestro-installer in $tmpdir" if [ -n "$REPO_BRANCH" ]; then cargo install --git "$REPO_URL" --branch "$REPO_BRANCH" \ --root "$tmpdir" --locked maestro-installer else cargo install --git "$REPO_URL" \ --root "$tmpdir" --locked maestro-installer fi exec "$tmpdir/bin/maestro-install" "$@"