mirror of
https://github.com/nushell/nushell.git
synced 2024-11-26 10:23:52 +01:00
Merge pull request #332 from jonathandturner/fix_abs_ls
Fix absolute ls
This commit is contained in:
commit
399b411a9c
@ -115,7 +115,11 @@ impl Shell for FilesystemShell {
|
||||
for entry in entries {
|
||||
let entry = entry?;
|
||||
let filepath = entry.path();
|
||||
let filename = filepath.strip_prefix(&cwd).unwrap();
|
||||
let filename = if let Ok(fname) = filepath.strip_prefix(&cwd) {
|
||||
fname
|
||||
} else {
|
||||
Path::new(&filepath)
|
||||
};
|
||||
let value = dir_entry_dict(
|
||||
filename,
|
||||
&entry.metadata()?,
|
||||
|
Loading…
Reference in New Issue
Block a user