Skip to content

Commit cc439ab

Browse files
committed
fix: skip unreadable files in build_tree instead of failing
Files whose content isn't available (e.g. iCloud files not downloaded locally) are now silently skipped rather than causing the entire tree build to fail.
1 parent 750aac9 commit cc439ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/tree/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ pub fn build_tree<P: AsRef<Utf8Path>>(base_dir: P) -> Result<RecipeTree, TreeErr
9595
let path = Utf8PathBuf::from_path_buf(path).map_err(|_| {
9696
TreeError::StripPrefixError("Path contains invalid UTF-8".to_string())
9797
})?;
98-
let recipe = RecipeEntry::from_path(path.clone())?;
98+
let recipe = match RecipeEntry::from_path(path.clone()) {
99+
Ok(r) => r,
100+
Err(_) => continue, // Skip files whose content isn't available (e.g. iCloud)
101+
};
99102

100103
// Calculate the relative path from the base directory
101104
let rel_path = path

0 commit comments

Comments
 (0)