MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getDebugDir

Function getDebugDir

web/src/util/logger.ts:20–36  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18// Ensure debug directory exists for local environment
19let debugDir: string | null | undefined
20function getDebugDir(): string | null {
21 if (debugDir !== undefined) {
22 return debugDir
23 }
24 // Walk up from cwd to find the git root (where .git exists)
25 let dir = process.cwd()
26 while (dir !== path.dirname(dir)) {
27 if (fs.existsSync(path.join(dir, '.git'))) {
28 debugDir = path.join(dir, 'debug')
29 return debugDir
30 }
31 dir = path.dirname(dir)
32 }
33 debugDir = null
34 console.error('Failed to find git root directory for logger')
35 return debugDir
36}
37
38// Initialize debug directory in dev environment
39if (IS_DEV && !IS_CI) {

Callers 1

logger.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected