Function
glob_md_files_recursive
(dir: &Path, results: &mut Vec<PathBuf>)
Source from the content-addressed store, hash-verified
| 689 | } |
| 690 | |
| 691 | fn glob_md_files_recursive(dir: &Path, results: &mut Vec<PathBuf>) -> Result<()> { |
| 692 | if !dir.is_dir() { |
| 693 | return Ok(()); |
| 694 | } |
| 695 | for entry in fs::read_dir(dir)? { |
| 696 | let entry = entry?; |
| 697 | let path = entry.path(); |
| 698 | if path.is_dir() { |
| 699 | glob_md_files_recursive(&path, results)?; |
| 700 | } else if path.extension().map(|e| e == "md").unwrap_or(false) { |
| 701 | results.push(path); |
| 702 | } |
| 703 | } |
| 704 | Ok(()) |
| 705 | } |
| 706 | |
| 707 | /// Parse a markdown file as a command definition. |
| 708 | /// Extracts YAML frontmatter and body content. |
Tested by
no test coverage detected