MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / dirsFromRootToCWD

Function dirsFromRootToCWD

agentContext/builder.go:438–462  ·  view source on GitHub ↗
(root, cwd string)

Source from the content-addressed store, hash-verified

436 return filepath.Dir(result.FallbackPath), nil
437 }
438 if len(result.Docs) > 0 {
439 return result.Root, nil
440 }
441 return "", errors.New("project instruction file not found")
442}
443
444func findProjectRootByMarkers(start string, markers []string) string {
445 current := start
446 for {
447 for _, marker := range markers {
448 marker = strings.TrimSpace(marker)
449 if marker == "" {
450 continue
451 }
452 if _, err := os.Stat(filepath.Join(current, marker)); err == nil {
453 return current
454 }
455 }
456 parent := filepath.Dir(current)
457 if parent == current {
458 return ""
459 }
460 current = parent
461 }
462}
463
464func dirsFromRootToCWD(root, cwd string) []string {
465 root = filepath.Clean(root)

Callers 1

DiscoverProjectDocsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected