MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cacheDir

Function cacheDir

pkg/go/cmd/codebase-memory-mcp/main.go:65–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63}
64
65func cacheDir() string {
66 if d := os.Getenv("CBM_CACHE_DIR"); d != "" {
67 return d
68 }
69 switch runtime.GOOS {
70 case "windows":
71 if d := os.Getenv("LOCALAPPDATA"); d != "" {
72 return filepath.Join(d, "codebase-memory-mcp")
73 }
74 case "darwin":
75 if home, err := os.UserHomeDir(); err == nil {
76 return filepath.Join(home, "Library", "Caches", "codebase-memory-mcp")
77 }
78 }
79 if d := os.Getenv("XDG_CACHE_HOME"); d != "" {
80 return filepath.Join(d, "codebase-memory-mcp")
81 }
82 if home, err := os.UserHomeDir(); err == nil {
83 return filepath.Join(home, ".cache", "codebase-memory-mcp")
84 }
85 return filepath.Join(os.TempDir(), "codebase-memory-mcp")
86}
87
88func goos() string {
89 switch runtime.GOOS {

Callers 1

binPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected