mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
fix force rm: should suppress error if directory is not found (#11656)
# Description Fix a breaking change which is introduced by #11621 `rm -f /tmp/aaa` shouldn't return error if `/tmp/aaa/` doesn't exist. # User-Facing Changes NaN # Tests + Formatting Done
This commit is contained in:
@ -480,3 +480,18 @@ fn rm_files_inside_glob_metachars_dir() {
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn force_rm_suppress_error() {
|
||||
Playground::setup("force_rm_suppress_error", |dirs, sandbox| {
|
||||
sandbox.with_files(vec![EmptyFile("test_file.txt")]);
|
||||
|
||||
// the second rm should suppress error.
|
||||
let actual = nu!(
|
||||
cwd: dirs.test(),
|
||||
"rm test_file.txt; rm -f test_file.txt",
|
||||
);
|
||||
|
||||
assert!(actual.err.is_empty());
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user