Files
settled-reach/tooling/validate-ron
T
jpmschweitzerandClaude Opus 4.6 b2ef56440f refactor(simulation): move content/ under server/ (#669)
Content files (RON templates, YAML campaigns, gauntlet data) are consumed
exclusively by the server. Colocate them at server/content/ and update all
path references in Rust source, tooling scripts, and schema files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:31:20 +01:00

36 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# RON content validator — wrapper for the Rust validate_ron binary (#611).
#
# Usage:
# tooling/validate-ron <file.ron> <zone|zone_type|culture>
#
# Examples:
# tooling/validate-ron server/content/global/zone-types/rural_agricultural.ron zone_type
# tooling/validate-ron server/content/global/culture-van-maanens-star.example.ron culture
# tooling/validate-ron server/content/global/zone-identity-spec.example.ron zone
set -euo pipefail
if [ $# -lt 2 ]; then
echo "Usage: tooling/validate-ron <file.ron> <zone|zone_type|culture>"
echo ""
echo "Validates a RON file against the Rust struct schema."
echo "Schema types:"
echo " zone_type — ZoneTypeTemplate (D-142 zone-type template)"
echo " zone — ZoneSpec (legacy zone identity spec)"
echo " culture — CultureProfile (culture profile)"
exit 1
fi
# Check file exists before resolving — realpath gives unhelpful errors otherwise
if [ ! -f "$1" ]; then
echo "Error: file not found: $1"
exit 1
fi
FILE="$(realpath "$1")"
SCHEMA="$2"
cd "$(dirname "$0")/../server"
exec cargo run --quiet --bin validate_ron -- "$FILE" "$SCHEMA"