Files
proxmox/docs/scripts/validate-doc-headers.sh
defiQUG fbda1b4beb
Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
docs: Ledger Live integration, contract deploy learnings, NEXT_STEPS updates
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands
- CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround
- CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check
- NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere
- MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates
- LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 15:46:57 -08:00

47 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# validate-doc-headers.sh - Check that docs have standard headers (Last Updated, Document Version, Status, ---)
# Usage: run from docs/ or repo root: ./docs/scripts/validate-doc-headers.sh [dir]
# Exit: 0 if all checked files pass, 1 if any fail.
# Optional: Document Version is warned only (not required for pass).
set -e
DOCS_DIR="${1:-.}"
if [[ "$DOCS_DIR" == . ]]; then
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOCS_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
fi
FAIL=0
WARN=0
while IFS= read -r -d '' f; do
if ! head -20 "$f" | grep -q '\*\*Last Updated:\*\*'; then
echo "Missing 'Last Updated:' in $f"
FAIL=1
fi
if ! head -20 "$f" | grep -q '\*\*Status:\*\*'; then
if ! head -20 "$f" | grep -q 'Status:'; then
echo "Missing 'Status:' in $f"
FAIL=1
fi
fi
if ! head -25 "$f" | grep -q '^---$'; then
echo "Missing '---' separator in first 25 lines of $f"
FAIL=1
fi
if ! head -20 "$f" | grep -q '\*\*Document Version:\*\*'; then
echo "Warning: Missing 'Document Version:' in $f"
WARN=1
fi
done < <(find "$DOCS_DIR" -maxdepth 3 -name '*.md' -not -path '*/archive/*' -print0 2>/dev/null)
if [[ $FAIL -eq 1 ]]; then
echo "One or more documents failed header validation."
exit 1
fi
if [[ $WARN -eq 1 ]]; then
echo "Header validation passed; some docs missing optional 'Document Version:'."
else
echo "Header validation passed for checked documents."
fi
exit 0