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

Function cacheDir

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

Source from the content-addressed store, hash-verified

290}
291
292func cacheDir() string {
293 if d := os.Getenv("CBM_CACHE_DIR"); d != "" {
294 return d
295 }
296 switch runtime.GOOS {
297 case "windows":
298 if d := os.Getenv("LOCALAPPDATA"); d != "" {
299 return filepath.Join(d, "codebase-memory-mcp")
300 }
301 case "darwin":
302 if home, err := os.UserHomeDir(); err == nil {
303 return filepath.Join(home, "Library", "Caches", "codebase-memory-mcp")
304 }
305 }
306 if d := os.Getenv("XDG_CACHE_HOME"); d != "" {
307 return filepath.Join(d, "codebase-memory-mcp")
308 }
309 if home, err := os.UserHomeDir(); err == nil {
310 return filepath.Join(home, ".cache", "codebase-memory-mcp")
311 }
312 return filepath.Join(os.TempDir(), "codebase-memory-mcp")
313}
314
315func goos() string {
316 switch runtime.GOOS {

Callers 1

binPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected