ls .file and ls **/.* show hidden files (#2379)

This commit is contained in:
Matt Clarke
2020-08-22 03:49:34 +02:00
committed by GitHub
parent 8f568f4fc5
commit d65a38dd41
2 changed files with 62 additions and 1 deletions

View File

@ -125,6 +125,8 @@ impl Shell for FilesystemShell {
}
};
let hidden_dir_specified = is_hidden_dir(&path);
let mut paths = glob::glob(&path.to_string_lossy())
.map_err(|e| ShellError::labeled_error(e.to_string(), "invalid pattern", &p_tag))?
.peekable();
@ -145,7 +147,7 @@ impl Shell for FilesystemShell {
Err(err) => return Some(Err(err)),
};
if !all && is_hidden_dir(&path) {
if !all && !hidden_dir_specified && is_hidden_dir(&path) {
return None;
}