mirror of
https://github.com/lsd-rs/lsd
synced 2024-12-14 14:12:31 +00:00
Match ignore-glob(s) against name instead of path
This commit is contained in:
parent
148c78d418
commit
b5e13f25c7
1 changed files with 6 additions and 6 deletions
|
@ -95,16 +95,16 @@ impl Meta {
|
|||
for entry in entries {
|
||||
let path = entry?.path();
|
||||
|
||||
if ignore_globs.is_match(&path) {
|
||||
let name = path
|
||||
.file_name()
|
||||
.ok_or_else(|| Error::new(ErrorKind::InvalidInput, "invalid file name"))?;
|
||||
|
||||
if ignore_globs.is_match(&name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if let Display::DisplayOnlyVisible = display {
|
||||
if path
|
||||
.file_name()
|
||||
.ok_or_else(|| Error::new(ErrorKind::InvalidInput, "invalid file name"))?
|
||||
.to_string_lossy()
|
||||
.starts_with('.')
|
||||
if name.to_string_lossy().starts_with('.')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue