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

Method writeConfig

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

Source from the content-addressed store, hash-verified

574 }
575
576 private writeConfig(config: ConfigFile): void {
577 const temp = `${this.configPath}.${process.pid}.${randomUUID()}.tmp`;
578 try {
579 fs.mkdirSync(this.dir, { recursive: true, mode: 0o700 });
580 // Readers must see either complete choice, never a truncated JSON file.
581 fs.writeFileSync(temp, JSON.stringify(config, null, 2) + '\n', { mode: 0o600 });
582 fs.renameSync(temp, this.configPath);
583 this.configCache = config;
584 } catch {
585 /* fail silent */
586 } finally {
587 try { fs.rmSync(temp, { force: true }); } catch { /* fail silent */ }
588 }
589 }
590
591 /**
592 * 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