π rc-scan.sh
Script Path:
bones/scripts/rc-scan.sh
Purpose
- Traverse the file tree to identify orphan files (not in manifest) and missing artifacts (in manifest but absent).
- Compute and record SHA256 checksums for all valid files.
- Produce machine-readable JSON and human-readable Markdown summaries.
CLI Interface
rc-scan.sh [--dry-run] [--verbose] [--help]Supported flags: - --help, -h Show usage
information and exit. - --dry-run Preview actions without
writing reports. - --verbose Show detailed logs.
Workflow Steps
- Parse Flags & Setup: Handle
--dry-run,--verbose, and--help. - Verify Dependencies:
check_deps find sha256sum yq. - Load Manifest: Read asset-manifest.yaml into
manifest_list. - Scan Files: Walk
home/assets/(or specified dir) intodisk_list. - Classification & Checksums: Identify missing, orphan files, compute SHA256.
- Report Generation: Write JSON and Markdown reports or preview under dry-run.
Exit Codes
0β Scan completed (even if orphans/missing found).1β Critical error (missing manifest, dependencies).2β No files found to scan.
Examples
# Standard scan
./bones/scripts/rc-scan.sh
# Preview scan without writing
./bones/scripts/rc-scan.sh --dry-run --verbose
# Show help
./bones/scripts/rc-scan.sh --help