Recursively collect every regular file under `root` (following the same hand-rolled walk both the Cursor and Codex installers rely on).
(root: &Path)
| 847 | /// Recursively collect every regular file under `root` (following the same |
| 848 | /// hand-rolled walk both the Cursor and Codex installers rely on). |
| 849 | pub(crate) fn collect_regular_files(root: &Path) -> std::io::Result<Vec<PathBuf>> { |
| 850 | let mut out = Vec::new(); |
| 851 | collect_regular_files_inner(root, &mut out)?; |
| 852 | Ok(out) |
| 853 | } |
| 854 | |
| 855 | fn collect_regular_files_inner(root: &Path, out: &mut Vec<PathBuf>) -> std::io::Result<()> { |
| 856 | for entry in std::fs::read_dir(root)? { |