MCPcopy
hub / github.com/docker/compose / MatchesEntireDir

Method MatchesEntireDir

pkg/watch/dockerignore.go:46–66  ·  view source on GitHub ↗
(f string)

Source from the content-addressed store, hash-verified

44}
45
46func (i dockerPathMatcher) MatchesEntireDir(f string) (bool, error) {
47 matches, err := i.Matches(f)
48 if !matches || err != nil {
49 return matches, err
50 }
51
52 // We match the dir, but we might exclude files underneath it.
53 if i.matcher.Exclusions() {
54 for _, pattern := range i.matcher.Patterns() {
55 if !pattern.Exclusion() {
56 continue
57 }
58 if paths.IsChild(f, pattern.String()) {
59 // Found an exclusion match -- we don't match this whole dir
60 return false, nil
61 }
62 }
63 return true, nil
64 }
65 return true, nil
66}
67
68func LoadDockerIgnore(build *types.BuildConfig) (PathMatcher, error) {
69 if build == nil {

Callers

nothing calls this directly

Calls 3

MatchesMethod · 0.95
IsChildFunction · 0.92
StringMethod · 0.45

Tested by

no test coverage detected