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

Function isInitialized

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

Source from the content-addressed store, hash-verified

142 * schema, or a file SQLite refuses as not a database, says no.
143 */
144export function isInitialized(projectRoot: string): boolean {
145 const codegraphDir = getCodeGraphDir(projectRoot);
146 if (!fs.existsSync(codegraphDir) || !fs.statSync(codegraphDir).isDirectory()) {
147 return false;
148 }
149 // Must have codegraph.db, not just .codegraph folder
150 const dbPath = path.join(codegraphDir, 'codegraph.db');
151 let st: fs.Stats;
152 try {
153 st = fs.statSync(dbPath);
154 } catch {
155 return false;
156 }
157 return hasCodeGraphSchema(dbPath, st);
158}
159
160/**
161 * `codegraph.db` exists at `projectRoot` but does not carry the schema, and

Callers 15

initMethod · 0.90
initSyncMethod · 0.90
openMethod · 0.90
recreateMethod · 0.90
openSyncMethod · 0.90
isInitializedMethod · 0.90
activateFunction · 0.90
acquireMethod · 0.90
resolveProjectPathFunction · 0.90
runInitFunction · 0.90
mainFunction · 0.90

Calls 3

getCodeGraphDirFunction · 0.85
hasCodeGraphSchemaFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected