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
This commit is contained in:
34
scripts/validation/validate-xdc-zero-config.sh
Executable file
34
scripts/validation/validate-xdc-zero-config.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user