MCPcopy Create free account
hub / github.com/coder/coder / resolvePathBestEffort

Function resolvePathBestEffort

agent/x/agentmcp/configwatcher.go:420–435  ·  view source on GitHub ↗
(abs string)

Source from the content-addressed store, hash-verified

418}
419
420func resolvePathBestEffort(abs string) string {
421 dir := filepath.Dir(abs)
422 base := filepath.Base(abs)
423 for dir != "" && dir != "." {
424 if resolved, err := filepath.EvalSymlinks(dir); err == nil {
425 return filepath.Join(resolved, base)
426 }
427 parent := filepath.Dir(dir)
428 base = filepath.Join(filepath.Base(dir), base)
429 if parent == dir {
430 break
431 }
432 dir = parent
433 }
434 return abs
435}

Callers 1

resolvePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected