#!/usr/bin/env bash
set -e

# Open the Nomarchy docs index in the default handler.
# On an installed system the source tree lives at ~/.local/share/nomarchy/
# (see SKILL.md's "Out of Scope" section), so the README — which links every
# doc in docs/ — is the canonical "open the manual" target.

README="$HOME/.local/share/nomarchy/README.md"

if [[ -f "$README" ]]; then
  echo "Opening Nomarchy manual: $README"
  xdg-open "$README"
else
  notify-send "Nomarchy Manual" \
    "Source tree not found at $README. Try \`nomarchy-update\` to sync it."
  exit 1
fi
