diff --git a/crates/nu-glob/src/lib.rs b/crates/nu-glob/src/lib.rs index ddaefc458d..a312f29217 100644 --- a/crates/nu-glob/src/lib.rs +++ b/crates/nu-glob/src/lib.rs @@ -782,7 +782,11 @@ fn fill_todo( } else { path.join(&s) }; - if (special && is_dir) || (!special && fs::metadata(&next_path).is_ok()) { + if (special && is_dir) + || (!special + && (fs::metadata(&next_path).is_ok() + || fs::symlink_metadata(&next_path).is_ok())) + { add(todo, next_path); } } @@ -966,7 +970,7 @@ mod test { .and_then(|p| match p.components().next().unwrap() { Component::Prefix(prefix_component) => { let path = Path::new(prefix_component.as_os_str()).join("*"); - Some(path) + Some(path.to_path_buf()) } _ => panic!("no prefix in this path"), })