render broken paths (symlinks)
This commit is contained in:
parent
44765c4167
commit
e0d271bb62
1 changed files with 7 additions and 2 deletions
|
|
@ -124,6 +124,11 @@ mod scanner {
|
|||
.to_string_lossy()
|
||||
.replace('\\', "/");
|
||||
display_name = format!("{name} → {target}");
|
||||
|
||||
// The symlink points to a target that doesn't exist
|
||||
if path.metadata().is_err() {
|
||||
display_name = format!("{display_name} (broken)");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3521,10 +3526,10 @@ mod scanner {
|
|||
|
||||
assert_snapshot!(fs_tree(&dir, &scanned_files(&mut scanner, &dir)), @"
|
||||
.
|
||||
├── ✗ a → c
|
||||
├── ✗ a → c (broken)
|
||||
├── ✓ b
|
||||
│ └── ✓ index.html
|
||||
├── ✗ c → b/c
|
||||
├── ✗ c → b/c (broken)
|
||||
└── ✓ z
|
||||
└── ✓ index.html
|
||||
");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue