#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
PUML="$ROOT/docs/diagrams/puml"
PNG="$ROOT/docs/diagrams/png"
SVG="$ROOT/docs/diagrams/svg"
mkdir -p "$PNG" "$SVG"
if ! command -v plantuml >/dev/null 2>&1; then
  echo "plantuml not found" >&2
  exit 1
fi
JAVA_TOOL_OPTIONS=-Djava.awt.headless=true plantuml -tpng -o "../png" "$PUML"/*.puml
JAVA_TOOL_OPTIONS=-Djava.awt.headless=true plantuml -tsvg -o "../svg" "$PUML"/*.puml
