mirror of
https://github.com/nushell/nushell.git
synced 2025-02-18 11:31:14 +01:00
"#194 Added trash switch checked before normal rm command action"
This commit is contained in:
parent
fc1301c92d
commit
74dddc880d
@ -944,14 +944,12 @@ impl Shell for FilesystemShell {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if path.is_dir() {
|
if trash.item {
|
||||||
|
SendToTrash::remove(path).unwrap();
|
||||||
|
} else if path.is_dir() {
|
||||||
std::fs::remove_dir_all(&path)?;
|
std::fs::remove_dir_all(&path)?;
|
||||||
} else if path.is_file() {
|
} else if path.is_file() {
|
||||||
if trash.item {
|
std::fs::remove_file(&path)?;
|
||||||
SendToTrash::remove(path).unwrap();
|
|
||||||
} else {
|
|
||||||
std::fs::remove_file(&path)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user