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

Function writeProjectPref

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

Source from the content-addressed store, hash-verified

45});
46
47function writeProjectPref(questionId: string, preference: string): void {
48 const f = path.join(stateRoot, 'projects', cwdSlug, 'question-preferences.json');
49 let prefs: Record<string, string> = {};
50 if (fs.existsSync(f)) prefs = JSON.parse(fs.readFileSync(f, 'utf-8'));
51 prefs[questionId] = preference;
52 fs.writeFileSync(f, JSON.stringify(prefs, null, 2));
53}
54
55function writeGlobalPref(questionId: string, preference: string): void {
56 const f = path.join(stateRoot, 'global-question-preferences.json');

Calls

no outgoing calls

Tested by

no test coverage detected