(projectRoot: string)
| 107 | * cached per process. |
| 108 | */ |
| 109 | export 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 |
no test coverage detected