If no children, THEN do the syscall

This commit is contained in:
Lncvrt committed 2026-04-15 16:40:42 -07:00
1 parent c339436d4c
commit 0913daff99
1 file changed
+1 -1
+1 -1
View File
@@ -102,7 +102,7 @@ fn stream(node: &serde_json::Value, parent: &str, map: &mut HashMap<String, Vec<
format!("{}/{}", parent, name)
};
let is_dir = PathBuf::from(&path).is_dir();
let is_dir = children.map_or(false, |c| !c.is_empty()) || PathBuf::from(&path).is_dir();
map.entry(parent.to_string()).or_default().push(FileInfo {
name: name.to_string(),