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

Function isInitialized

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

Source from the content-addressed store, hash-verified

139 * schema, or a file SQLite refuses as not a database, says no.
140 */
141export function isInitialized(projectRoot: string): boolean {
142 const codegraphDir = getCodeGraphDir(projectRoot);
143 if (!fs.existsSync(codegraphDir) || !fs.statSync(codegraphDir).isDirectory()) {
144 return false;
145 }
146 // Must have codegraph.db, not just .codegraph folder
147 const dbPath = path.join(codegraphDir, 'codegraph.db');
148 let st: fs.Stats;
149 try {
150 st = fs.statSync(dbPath);
151 } catch {
152 return false;
153 }
154 return hasCodeGraphSchema(dbPath, st);
155}
156
157/**
158 * `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