MCPcopy Create free account
hub / github.com/garrytan/gstack / writeGlobalPref

Function writeGlobalPref

test/question-preference-hook.test.ts:55–61  ·  view source on GitHub ↗
(questionId: string, preference: string)

Source from the content-addressed store, hash-verified

53}
54
55function writeGlobalPref(questionId: string, preference: string): void {
56 const f = path.join(stateRoot, 'global-question-preferences.json');
57 let prefs: Record<string, string> = {};
58 if (fs.existsSync(f)) prefs = JSON.parse(fs.readFileSync(f, 'utf-8'));
59 prefs[questionId] = preference;
60 fs.writeFileSync(f, JSON.stringify(prefs, null, 2));
61}
62
63function runHook(stdin: object, cwd?: string, extraEnv?: Record<string, string>): {
64 stdout: string;

Calls

no outgoing calls

Tested by

no test coverage detected