MCPcopy Create free account
hub / github.com/dagger/dagger / Match

Method Match

core/modtree.go:786–806  ·  view source on GitHub ↗
(ctx context.Context, patterns []string)

Source from the content-addressed store, hash-verified

784}
785
786func (node *ModTreeNode) Match(ctx context.Context, patterns []string) (bool, error) {
787 if node.Parent == nil {
788 // The root node matches everything
789 return true, nil
790 }
791 if len(patterns) == 0 {
792 return true, nil
793 }
794 for _, pattern := range patterns {
795 if match, err := node.Path().Glob(ctx, pattern); err != nil {
796 return false, err
797 } else if match {
798 return true, nil
799 }
800 patternAsPath := NewModTreePath(pattern)
801 if patternAsPath.Contains(ctx, node.Path()) {
802 return true, nil
803 }
804 }
805 return false, nil
806}
807
808func (node *ModTreeNode) PathString() string {
809 return strings.Join(node.Path().CliCase(), ":")

Callers 15

RunMethod · 0.95
RollupNodesMethod · 0.45
getEmulatorFunction · 0.45
resolveIndexFunction · 0.45
matchWorkspaceIncludeFunction · 0.45
includedPathsMethod · 0.45
pruneMethod · 0.45
DiskUsageMethod · 0.45

Calls 4

PathMethod · 0.95
ContainsMethod · 0.95
NewModTreePathFunction · 0.85
GlobMethod · 0.45

Tested by 1

checkDaggerVersionOutputFunction · 0.36