forked from TrueCloudLab/rclone
ListContainsExcludeFile: checks for exclude file in the list
This commit is contained in:
parent
421ba84e12
commit
5d05df3124
1 changed files with 17 additions and 0 deletions
17
fs/filter.go
17
fs/filter.go
|
@ -385,6 +385,23 @@ func (f *Filter) includeRemote(remote string) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ListContainsExcludeFile checks if exclude file is present in the list.
|
||||||
|
func (f *Filter) ListContainsExcludeFile(entries DirEntries) bool {
|
||||||
|
if len(f.ExcludeFile) == 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
for _, entry := range entries {
|
||||||
|
obj, ok := entry.(Object)
|
||||||
|
if ok {
|
||||||
|
basename := path.Base(obj.Remote())
|
||||||
|
if basename == f.ExcludeFile {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
// IncludeDirectory returns whether this directory should be included
|
// IncludeDirectory returns whether this directory should be included
|
||||||
// in the sync or not.
|
// in the sync or not.
|
||||||
func (f *Filter) IncludeDirectory(remote string) bool {
|
func (f *Filter) IncludeDirectory(remote string) bool {
|
||||||
|
|
Loading…
Add table
Reference in a new issue