MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / writeAuthJson

Method writeAuthJson

src/runtime/config.ts:394–406  ·  view source on GitHub ↗
(authJson: string)

Source from the content-addressed store, hash-verified

392 return JSON.stringify(config._auth);
393 }
394 return undefined;
395 } catch {
396 return undefined;
397 }
398 }
399
400 private writeAuthJson(authJson: string): void {
401 this.ensureFile();
402 try {
403 const raw = fs.readFileSync(this.configPath, "utf-8");
404 const config = JSON.parse(raw);
405 config._auth = JSON.parse(authJson);
406 fs.writeFileSync(this.configPath, JSON.stringify(config, null, 2), "utf-8");
407 } catch {
408 // If config.json is unreadable, write a minimal file
409 const config = { _auth: JSON.parse(authJson) };

Callers 2

withLockMethod · 0.95
withLockAsyncMethod · 0.95

Calls 2

ensureFileMethod · 0.95
parseMethod · 0.80

Tested by

no test coverage detected