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

Method withLock

src/runtime/config.ts:408–415  ·  view source on GitHub ↗
(fn: (current: string | undefined) => LockResult<T>)

Source from the content-addressed store, hash-verified

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) };
410 fs.writeFileSync(this.configPath, JSON.stringify(config, null, 2), "utf-8");
411 }
412 }
413
414 withLock<T>(fn: (current: string | undefined) => LockResult<T>): T {
415 const current = this.readAuthJson();
416 const { result, next } = fn(current);
417 if (next !== undefined) {
418 this.writeAuthJson(next);

Callers

nothing calls this directly

Calls 2

readAuthJsonMethod · 0.95
writeAuthJsonMethod · 0.95

Tested by

no test coverage detected