MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / codeGraphDirNameFor

Function codeGraphDirNameFor

src/directory.ts:109–118  ·  view source on GitHub ↗
(projectRoot: string)

Source from the content-addressed store, hash-verified

107 * cached per process.
108 */
109export function codeGraphDirNameFor(projectRoot: string): string {
110 if (process.env.CODEGRAPH_DIR?.trim() || !isWslWindowsDrive(projectRoot)) return codeGraphDirName();
111 try {
112 if (fs.statSync(path.join(projectRoot, WSL_CODEGRAPH_DIR)).isDirectory()) return WSL_CODEGRAPH_DIR;
113 } catch {
114 // absent — fall through
115 }
116 if (fs.existsSync(path.join(projectRoot, DEFAULT_CODEGRAPH_DIR, 'codegraph.db'))) return DEFAULT_CODEGRAPH_DIR;
117 return WSL_CODEGRAPH_DIR;
118}
119
120/**
121 * Get the .codegraph directory path for a project

Callers 2

getCodeGraphDirFunction · 0.85

Calls 3

isWslWindowsDriveFunction · 0.90
codeGraphDirNameFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected