mirror of
https://github.com/nushell/nushell
synced 2024-12-28 14:03:09 +00:00
Fix tests
This commit is contained in:
parent
303d27d4b6
commit
87930ba35a
1 changed files with 7 additions and 7 deletions
|
@ -831,13 +831,7 @@ impl Shell for FilesystemShell {
|
||||||
) -> Result<VecDeque<ReturnValue>, ShellError> {
|
) -> Result<VecDeque<ReturnValue>, ShellError> {
|
||||||
let name_span = name;
|
let name_span = name;
|
||||||
|
|
||||||
let mut path = PathBuf::from(path);
|
if target.item.to_str() == Some(".") || target.item.to_str() == Some("..") {
|
||||||
|
|
||||||
path.push(&target.item);
|
|
||||||
|
|
||||||
let file = path.to_string_lossy();
|
|
||||||
|
|
||||||
if file == "." || file == ".." {
|
|
||||||
return Err(ShellError::labeled_error(
|
return Err(ShellError::labeled_error(
|
||||||
"Remove aborted. \".\" or \"..\" may not be removed.",
|
"Remove aborted. \".\" or \"..\" may not be removed.",
|
||||||
"Remove aborted. \".\" or \"..\" may not be removed.",
|
"Remove aborted. \".\" or \"..\" may not be removed.",
|
||||||
|
@ -845,6 +839,12 @@ impl Shell for FilesystemShell {
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let mut path = PathBuf::from(path);
|
||||||
|
|
||||||
|
path.push(&target.item);
|
||||||
|
|
||||||
|
let file = path.to_string_lossy();
|
||||||
|
|
||||||
let entries: Vec<_> = match glob::glob(&path.to_string_lossy()) {
|
let entries: Vec<_> = match glob::glob(&path.to_string_lossy()) {
|
||||||
Ok(files) => files.collect(),
|
Ok(files) => files.collect(),
|
||||||
Err(_) => {
|
Err(_) => {
|
||||||
|
|
Loading…
Reference in a new issue