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

Method writeConfig

src/telemetry/index.ts:430–443  ·  view source on GitHub ↗
(config: ConfigFile)

Source from the content-addressed store, hash-verified

428 }
429
430 private writeConfig(config: ConfigFile): void {
431 const temp = `${this.configPath}.${process.pid}.${randomUUID()}.tmp`;
432 try {
433 fs.mkdirSync(this.dir, { recursive: true, mode: 0o700 });
434 // Readers must see either complete choice, never a truncated JSON file.
435 fs.writeFileSync(temp, JSON.stringify(config, null, 2) + '\n', { mode: 0o600 });
436 fs.renameSync(temp, this.configPath);
437 this.configCache = config;
438 } catch {
439 /* fail silent */
440 } finally {
441 try { fs.rmSync(temp, { force: true }); } catch { /* fail silent */ }
442 }
443 }
444
445 /**
446 * Default-on consent is gated by a one-time stderr notice (interactive

Callers 2

setEnabledMethod · 0.95
firstRunNoticeMethod · 0.95

Calls 1

randomUUIDFunction · 0.85

Tested by

no test coverage detected