mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
Hack fix around JWalk behaviour.
Jwalk returns '/' as a child of the current node which breaks things. https://github.com/jessegrosjean/jwalk/issues/13
This commit is contained in:
@@ -125,6 +125,11 @@ fn examine_dir(
|
|||||||
}
|
}
|
||||||
// This path and all its parent paths have their counter incremented
|
// This path and all its parent paths have their counter incremented
|
||||||
for path_name in e.path().ancestors() {
|
for path_name in e.path().ancestors() {
|
||||||
|
// This is required due to bug in Jwalk that adds '/' to all sub dir lists
|
||||||
|
// see: https://github.com/jessegrosjean/jwalk/issues/13
|
||||||
|
if path_name.to_string_lossy() == "/" && top_dir != "/" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
let path_name = path_name.to_string_lossy();
|
let path_name = path_name.to_string_lossy();
|
||||||
let s = data.entry(path_name.to_string()).or_insert(0);
|
let s = data.entry(path_name.to_string()).or_insert(0);
|
||||||
*s += size;
|
*s += size;
|
||||||
|
|||||||
Reference in New Issue
Block a user