#!/usr/bin/env bash
# dev-down.sh — tear down the DEV Synapse (matrix-p1-dev). DEV-ONLY.
#   ./dev-down.sh            # stop + remove containers, keep ./.data
#   ./dev-down.sh --purge    # also delete ./.data (fresh next bring-up)
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
docker compose -f "${HERE}/docker-compose.dev.yml" --profile element down -v --remove-orphans || true
if [[ "${1:-}" == "--purge" ]]; then
  rm -rf "${HERE}/.data"
  echo "[dev-down] purged ${HERE}/.data"
fi
echo "[dev-down] matrix-p1-dev stopped"
