MCPcopy Create free account
hub / github.com/JordanCoin/codemap / matchPath

Function matchPath

skills/loader.go:225–238  ·  view source on GitHub ↗

matchPath does a simple glob-like match: supports * and ** patterns, and falls back to substring matching.

(pattern, path string)

Source from the content-addressed store, hash-verified

223// matchPath does a simple glob-like match: supports * and ** patterns,
224// and falls back to substring matching.
225func matchPath(pattern, path string) bool {
226 // Simple substring match for non-glob patterns
227 if !strings.ContainsAny(pattern, "*?") {
228 return strings.Contains(path, pattern)
229 }
230 // Use filepath.Match for simple globs
231 matched, _ := filepath.Match(pattern, path)
232 if matched {
233 return true
234 }
235 // Also try matching against just the filename
236 matched, _ = filepath.Match(pattern, filepath.Base(path))
237 return matched
238}

Callers 2

TestMatchPathFunction · 0.85
MatchSkillsMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestMatchPathFunction · 0.68