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

Function walkUpward

internal/envfile/envfile.go:58–74  ·  view source on GitHub ↗
(start string)

Source from the content-addressed store, hash-verified

56}
57
58func walkUpward(start string) string {
59 dir := start
60 for {
61 candidate := filepath.Join(dir, ".env")
62 if pathutil.Exists(candidate) {
63 return candidate
64 }
65 if pathutil.Exists(filepath.Join(dir, ".git")) {
66 return ""
67 }
68 parent := filepath.Dir(dir)
69 if parent == dir {
70 return ""
71 }
72 dir = parent
73 }
74}
75
76// Load reads path and returns the parsed key/value pairs. An error from Load
77// indicates a syntactically invalid file; missing files are surfaced as the

Callers 1

FindFunction · 0.85

Calls 1

ExistsFunction · 0.92

Tested by

no test coverage detected