diff --git a/files/filter.go b/files/filter.go index 6b90f1f34..93e3e71e4 100644 --- a/files/filter.go +++ b/files/filter.go @@ -1,6 +1,7 @@ package files import ( + "fmt" "os" ignore "github.com/crackcomm/go-gitignore" @@ -45,5 +46,8 @@ func (filter *Filter) ShouldExclude(fileInfo os.FileInfo) (result bool) { if !filter.IncludeHidden && isHidden(fileInfo) { return true } + if fileInfo.IsDir() { + path = fmt.Sprintf("%s/", path) + } return filter.Rules.MatchesPath(path) }