(projectRoot: string)
| 91 | * Requires both .codegraph/ directory AND codegraph.db to exist |
| 92 | */ |
| 93 | export function isInitialized(projectRoot: string): boolean { |
| 94 | const codegraphDir = getCodeGraphDir(projectRoot); |
| 95 | if (!fs.existsSync(codegraphDir) || !fs.statSync(codegraphDir).isDirectory()) { |
| 96 | return false; |
| 97 | } |
| 98 | // Must have codegraph.db, not just .codegraph folder |
| 99 | const dbPath = path.join(codegraphDir, 'codegraph.db'); |
| 100 | return fs.existsSync(dbPath); |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Find the nearest parent directory containing .codegraph/ |
no test coverage detected