MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / resolveScanRoots

Function resolveScanRoots

internal/metadata/discover.go:101–121  ·  view source on GitHub ↗
(root, subPath string)

Source from the content-addressed store, hash-verified

99}
100
101func resolveScanRoots(root, subPath string) []string {
102 if subPath == "" {
103 return []string{root}
104 }
105 var roots []string
106 for _, sp := range strings.Split(subPath, "|") {
107 sp = strings.TrimSpace(strings.Trim(sp, "/"))
108 if sp == "" {
109 roots = append(roots, root)
110 continue
111 }
112 candidate := filepath.Join(root, sp)
113 if _, err := os.Stat(candidate); err == nil {
114 roots = append(roots, candidate)
115 }
116 }
117 if len(roots) == 0 {
118 roots = append(roots, root)
119 }
120 return roots
121}
122
123func resourceFromFile(root, p, base string, kind entities.Kind) (DiscoveredResource, bool) {
124 switch kind {

Callers 1

DiscoverResourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected