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

Function joinHome

internal/pathutil/pathutil.go:26–36  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

24}
25
26func joinHome(path string) string {
27 home := Home()
28 if strings.HasPrefix(home, "/") && !strings.Contains(home, "\\") {
29 path = strings.TrimPrefix(path, "/")
30 if path == "" {
31 return strings.TrimRight(home, "/")
32 }
33 return strings.TrimRight(home, "/") + "/" + path
34 }
35 return filepath.Join(home, path)
36}
37
38// Expand resolves a leading "~" segment to the user's home directory.
39//

Callers 1

ExpandFunction · 0.85

Calls 1

HomeFunction · 0.85

Tested by

no test coverage detected