ci / rust (push) Successful in 1m30s
Single command for both first install and subsequent updates: curl -sSf https://git.naps.pt/naps62/maestro/raw/branch/main/install.sh | sh Builds `maestro-installer` into a temp `--root`, runs the wizard, cleans up — so only `maestrod` and `maestro` persist in `~/.cargo/bin`. Re-running updates in place via cargo install's overwrite semantics. Wizard flags pass through with `sh -s --`. Docs updated to lead with the one-liner. Refs NAP-225.
38 lines
1.2 KiB
Bash
Executable File
38 lines
1.2 KiB
Bash
Executable File
#!/bin/sh
|
|
# Bootstrap installer for maestro. Builds the `maestro-installer` crate into a
|
|
# scratch dir, runs the wizard, and cleans up — leaving only the binaries the
|
|
# wizard installs (`maestrod`, `maestro`) 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 binaries.
|
|
|
|
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" "$@"
|