tokmd-walk
File listing and asset discovery utilities for tokmd.
Overview
This is a Tier 2 utility crate for filesystem traversal with gitignore support. It provides efficient file listing and license candidate detection.
Installation
[]
= "1.3"
Usage
use ;
use Path;
// List all files respecting gitignore
let files = list_files?;
// Find license-related files
let candidates = license_candidates;
println!;
println!;
// Get file size
let size = file_size?;
Key Functions
File Listing
Lists files respecting gitignore. Tries git ls-files first, falls back to the ignore crate.
License Detection
Identifies common license files:
- License files:
LICENSE*,COPYING*,NOTICE* - Metadata:
Cargo.toml,package.json,pyproject.toml
File Size
Behavior
- Try
git ls-filesfor accurate repo file listing - Fall back to
ignorecrate with gitignore support - Sort files alphabetically for deterministic output
Dependencies
ignore- Gitignore-aware file walkinganyhow- Error handling
License
MIT OR Apache-2.0