mirror of
https://github.com/nushell/nushell.git
synced 2025-04-24 05:08:29 +02:00
Fix absolute ls
This commit is contained in:
parent
3c7ca8c403
commit
effbc56ec8
@ -110,7 +110,11 @@ impl Shell for FilesystemShell {
|
|||||||
for entry in entries {
|
for entry in entries {
|
||||||
let entry = entry?;
|
let entry = entry?;
|
||||||
let filepath = entry.path();
|
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(
|
let value = dir_entry_dict(
|
||||||
filename,
|
filename,
|
||||||
&entry.metadata()?,
|
&entry.metadata()?,
|
||||||
|
Loading…
Reference in New Issue
Block a user