add filters for file/dir only and ignoring hidden

This commit is contained in:
Lilian Jónsdóttir 2024-06-19 19:13:10 -07:00
parent 2f56ecf40b
commit f78bec0a27
5 changed files with 215 additions and 62 deletions

View file

@ -79,7 +79,7 @@ func FindFiles(trashdir, ogdir string, f *filter.Filter) (files Infos, outerr er
return nil
}
if f.Match(filename, date) {
if f.Match(filename, date, info.IsDir()) {
log.Debugf("%s: deleted on %s", filename, date.Format(trash_info_date_fmt))
files = append(files, Info{
name: filename,