#!/bin/bash

ROOT=$(pwd)
OUTPUT_FORMAT="png"
PLANTUML_JAR="$ROOT/bin/plantuml.jar"

# Process PlantUML files in root directory
if ls "$ROOT"/*.plantuml 1> /dev/null 2>&1; then
    java -jar "$PLANTUML_JAR" -t"$OUTPUT_FORMAT" "$ROOT"/*.plantuml
fi

# Process PlantUML files in docs directory
if [ -d "$ROOT/docs" ]; then
    cd docs
    if ls *.plantuml 1> /dev/null 2>&1; then
        java -jar "$PLANTUML_JAR" -t"$OUTPUT_FORMAT" *.plantuml
    fi
fi
