#!/bin/bash
# macOS double-click installer. Double-click this file (Bearhole Installer) in
# Finder — it opens Terminal, downloads the installer, and runs it interactively
# so you get the "where to install?" prompt.
#
# First time: macOS may say "unidentified developer". If so, RIGHT-CLICK this
# file → Open → Open. (It's unsigned because Bearhole has no company/cloud.)
set -e
SITE="${BEARHOLE_SITE:-https://bearhole.dk}"
tmp="$(mktemp -t bearhole-install).sh"
echo "Downloading the Bearhole installer…"
if command -v curl >/dev/null 2>&1; then curl -fSL "$SITE/install.sh" -o "$tmp"
else echo "curl not found (unexpected on macOS)."; read -n1 -r; exit 1; fi
bash "$tmp"
echo ""
echo "You can close this window. Press any key…"
read -n1 -r
