MCPcopy
hub / github.com/six2dez/OneListForAll / IsVersionPath

Function IsVersionPath

internal/classify/classify.go:270–287  ·  view source on GitHub ↗

IsVersionPath checks if a path matches a version directory pattern.

(relPath, versionPattern string)

Source from the content-addressed store, hash-verified

268
269// IsVersionPath checks if a path matches a version directory pattern.
270func IsVersionPath(relPath, versionPattern string) bool {
271 if versionPattern == "" {
272 return false
273 }
274 matched, _ := filepath.Match(versionPattern, relPath)
275 if matched {
276 return true
277 }
278 // Check if any parent directory matches
279 parts := strings.Split(filepath.ToSlash(relPath), "/")
280 for i := range parts {
281 partial := strings.Join(parts[:i+1], "/")
282 if m, _ := filepath.Match(versionPattern, partial); m {
283 return true
284 }
285 }
286 return false
287}
288
289// splitKeywords splits a string on common separators.
290func splitKeywords(s string) []string {

Callers 1

RunFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected