mirror of
https://github.com/lsd-rs/lsd
synced 2024-12-14 22:22:26 +00:00
fix crash when given file doesn't exist
This commit is contained in:
parent
b0c75f47cf
commit
4485087759
1 changed files with 9 additions and 1 deletions
10
src/core.rs
10
src/core.rs
|
@ -67,8 +67,16 @@ impl Core {
|
|||
};
|
||||
|
||||
for path in paths {
|
||||
let absolute_path = match fs::canonicalize(&path) {
|
||||
Ok(path) => path,
|
||||
Err(err) => {
|
||||
println!("couldn't access '{}': {}", path.display(), err);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
match Meta::from_path_recursive(
|
||||
&fs::canonicalize(&path.to_path_buf()).unwrap(),
|
||||
&fs::canonicalize(&absolute_path.to_path_buf()).unwrap(),
|
||||
depth,
|
||||
self.flags.display_all,
|
||||
) {
|
||||
|
|
Loading…
Reference in a new issue