MCPcopy
hub / github.com/Doorman11991/smallcode / activate

Method activate

src/session/contract_store.js:63–73  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

61 }
62
63 activate(id) {
64 const c = this.get(id);
65 if (!c) throw new Error(`contract not found: ${id}`);
66 if (c.status === STATUSES.DRAFT) {
67 c.status = STATUSES.ACTIVE;
68 this.save(c);
69 }
70 fs.mkdirSync(contractsDir(this.cwd), { recursive: true });
71 writeAtomic(activeFile(this.cwd), id);
72 this._log(c.id, 'activate', {});
73 }
74
75 deactivate() {
76 const p = activeFile(this.cwd);

Callers

nothing calls this directly

Calls 6

getMethod · 0.95
saveMethod · 0.95
_logMethod · 0.95
contractsDirFunction · 0.85
writeAtomicFunction · 0.85
activeFileFunction · 0.85

Tested by

no test coverage detected