Files
proxmox/scripts/validation/validate-xdc-zero-config.sh
defiQUG dbd517b279 Sync workspace: config, docs, scripts, CI, operator rules, and submodule pointers.
- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains
- Omit embedded publish git dirs and empty placeholders from index

Made-with: Cursor
2026-04-12 06:12:20 -07:00

35 lines
769 B
Bash
Executable File

#!/usr/bin/env bash
# Parse-check JSON under config/xdc-zero/ (templates + merge fragments).
# Usage: bash scripts/validation/validate-xdc-zero-config.sh [--dry-run]
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
DIR="$PROJECT_ROOT/config/xdc-zero"
DRY_RUN=false
for a in "$@"; do [[ "$a" == "--dry-run" ]] && DRY_RUN=true && break; done
if $DRY_RUN; then
echo "Would jq-empty-parse: $DIR/*.json"
exit 0
fi
command -v jq >/dev/null 2>&1 || {
echo "ERROR: jq required" >&2
exit 1
}
ERR=0
for f in "$DIR"/*.json; do
[[ -f "$f" ]] || continue
if jq empty "$f" 2>/dev/null; then
echo "[OK] $f"
else
echo "[ERROR] invalid JSON: $f" >&2
ERR=1
fi
done
exit "$ERR"