mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 06:38:43 +02:00
Enable the use of multiple dots in FS Shell commands (#1547)
Every dot after `..` means another parent directory.
This commit is contained in:
committed by
GitHub
parent
c4daa2e40f
commit
d0618b0b32
@ -242,3 +242,26 @@ fn allows_doubly_specified_file() {
|
||||
assert!(!actual.contains("error"))
|
||||
})
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn remove_files_from_two_parents_up_using_multiple_dots_and_glob() {
|
||||
Playground::setup("rm_test_13", |dirs, sandbox| {
|
||||
sandbox.with_files(vec![
|
||||
EmptyFile("yehuda.txt"),
|
||||
EmptyFile("jonathan.txt"),
|
||||
EmptyFile("kevin.txt"),
|
||||
]);
|
||||
|
||||
sandbox.within("foo").mkdir("bar");
|
||||
|
||||
nu!(
|
||||
cwd: dirs.test().join("foo/bar"),
|
||||
"rm .../*.txt"
|
||||
);
|
||||
|
||||
assert!(!files_exist_at(
|
||||
vec!["yehuda.txt", "jonathan.txt", "kevin.txt"],
|
||||
dirs.test()
|
||||
));
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user