MCPcopy Create free account
hub / github.com/backnotprop/plannotator / saveConfig

Function saveConfig

packages/shared/config.ts:170–188  ·  view source on GitHub ↗
(partial: Partial<PlannotatorConfig>)

Source from the content-addressed store, hash-verified

168 * Creates ~/.plannotator/ directory if needed.
169 */
170export function saveConfig(partial: Partial<PlannotatorConfig>): void {
171 try {
172 const current = loadConfig();
173 const mergedDiffOptions = (current.diffOptions || partial.diffOptions)
174 ? { ...current.diffOptions, ...partial.diffOptions }
175 : undefined;
176 const mergedPrompts = mergePromptConfig(current.prompts, partial.prompts);
177 const merged = {
178 ...current,
179 ...partial,
180 diffOptions: mergedDiffOptions,
181 prompts: mergedPrompts,
182 };
183 mkdirSync(CONFIG_DIR, { recursive: true });
184 writeFileSync(CONFIG_PATH, JSON.stringify(merged, null, 2) + "\n", "utf-8");
185 } catch (e) {
186 process.stderr.write(`[plannotator] Warning: failed to write config.json: ${e}\n`);
187 }
188}
189
190/**
191 * Detect the git user name from `git config user.name`.

Callers 8

fetchFunction · 0.90
fetchFunction · 0.90
fetchFunction · 0.90
fetchFunction · 0.90
configureServerFunction · 0.85
startReviewServerFunction · 0.85
startPlanReviewServerFunction · 0.85
startAnnotateServerFunction · 0.85

Calls 2

loadConfigFunction · 0.85
mergePromptConfigFunction · 0.85

Tested by

no test coverage detected