MCPcopy Create free account
hub / github.com/astercloud/aster / ProjectConfigFile

Function ProjectConfigFile

pkg/config/paths.go:177–192  ·  view source on GitHub ↗

ProjectConfigFile returns the path to project-level config file. It searches from the current directory upward for .aster/config.yaml

(startDir string)

Source from the content-addressed store, hash-verified

175// ProjectConfigFile returns the path to project-level config file.
176// It searches from the current directory upward for .aster/config.yaml
177func ProjectConfigFile(startDir string) string {
178 dir := startDir
179 for {
180 configPath := filepath.Join(dir, ".aster", "config.yaml")
181 if _, err := os.Stat(configPath); err == nil {
182 return configPath
183 }
184
185 parent := filepath.Dir(dir)
186 if parent == dir {
187 // Reached root
188 return ""
189 }
190 dir = parent
191 }
192}
193
194// ResolveConfigFile returns the effective config file path.
195// Priority: project config > global config

Callers 2

ResolveConfigFileFunction · 0.85
TestProjectConfigFileFunction · 0.85

Calls 2

StatMethod · 0.65
JoinMethod · 0.45

Tested by 1

TestProjectConfigFileFunction · 0.68