MCPcopy Index your code
hub / github.com/garrytan/gstack / readStateFile

Function readStateFile

design/src/daemon-state.ts:89–95  ·  view source on GitHub ↗
(stateFile: string = resolveStateFilePath())

Source from the content-addressed store, hash-verified

87}
88
89export function readStateFile(stateFile: string = resolveStateFilePath()): DaemonState | null {
90 try {
91 return JSON.parse(fs.readFileSync(stateFile, "utf-8")) as DaemonState;
92 } catch {
93 return null;
94 }
95}
96
97export function writeStateFile(
98 state: DaemonState,

Callers 6

ensureDaemonFunction · 0.90
spawnDaemonFunction · 0.90
shutdownDaemonFunction · 0.90
daemonStatusFunction · 0.90

Calls 1

resolveStateFilePathFunction · 0.85

Tested by

no test coverage detected