MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readState

Function readState

e2e/scripts/cli.ts:49–55  ·  view source on GitHub ↗
(target: string)

Source from the content-addressed store, hash-verified

47
48const statePath = (target: string) => join(devDir, `${target}.json`);
49const readState = (target: string): InstanceState | undefined => {
50 try {
51 return JSON.parse(readFileSync(statePath(target), "utf8")) as InstanceState;
52 } catch {
53 return undefined;
54 }
55};
56const writeState = (state: InstanceState) => {
57 mkdirSync(devDir, { recursive: true });
58 writeFileSync(statePath(state.target), JSON.stringify(state, null, 1));

Callers 5

upFunction · 0.85
loadTargetFunction · 0.85
ledgerFunction · 0.85
downFunction · 0.85
logsFunction · 0.85

Calls 1

statePathFunction · 0.85

Tested by

no test coverage detected