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

Function LoadLocalSource

internal/repoconfig/repoconfig.go:238–248  ·  view source on GitHub ↗

LoadLocalSource reads a JSON repo file from the given path, expanding ~. Used for both config.yaml local sources and direct path lookups.

(path string)

Source from the content-addressed store, hash-verified

236// LoadLocalSource reads a JSON repo file from the given path, expanding ~.
237// Used for both config.yaml local sources and direct path lookups.
238func LoadLocalSource(path string) (map[string]RepoEntry, error) {
239 resolved := pathutil.Expand(path)
240 data, err := os.ReadFile(resolved)
241 if err != nil {
242 if os.IsNotExist(err) {
243 return nil, nil
244 }
245 return nil, err
246 }
247 return parseRepoJSON(data)
248}
249
250func loadRemoteWithCache(url string, kind entities.Kind, cache camconfig.CacheConfig) (map[string]RepoEntry, error) {
251 if cache.Enabled {

Callers 5

identifyLocalRepoKeysFunction · 0.92
TestLoadLocalSourceFunction · 0.85
LoadAllFunction · 0.85

Calls 3

ExpandFunction · 0.92
parseRepoJSONFunction · 0.85
ReadFileMethod · 0.80

Tested by 3

TestLoadLocalSourceFunction · 0.68