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

Function codeGraphDirNameFor

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

Source from the content-addressed store, hash-verified

108 * cached per process.
109 */
110export function codeGraphDirNameFor(projectRoot: string): string {
111 if (process.env.CODEGRAPH_DIR?.trim() || !isWslWindowsDrive(projectRoot)) return codeGraphDirName();
112 try {
113 if (fs.statSync(path.join(projectRoot, WSL_CODEGRAPH_DIR)).isDirectory()) return WSL_CODEGRAPH_DIR;
114 } catch {
115 // absent — fall through
116 }
117 if (fs.existsSync(path.join(projectRoot, DEFAULT_CODEGRAPH_DIR, 'codegraph.db'))) return DEFAULT_CODEGRAPH_DIR;
118 return WSL_CODEGRAPH_DIR;
119}
120
121/**
122 * 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