#!/usr/bin/env bash
# install-installer.sh — Installs vintage-radio-install.sh into /usr/local/bin.
#
# Run this once on a host to make `bash /usr/local/bin/vintage-radio-install.sh`
# available as a system command. Idempotent.

set -euo pipefail

SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SRC="${SELF_DIR}/install.sh"
DEST="/usr/local/bin/vintage-radio-install.sh"

if [[ ! -f "$SRC" ]]; then
  echo "FATAL: $SRC not found" >&2
  exit 1
fi

install -m 0755 "$SRC" "$DEST"
echo "Installed: $SRC -> $DEST"
echo "Run it with:  bash $DEST"
