fix: deep-merge prompt recommendations to preserve existing settings
This commit is contained in:
parent
d3be35525a
commit
647f4560ed
|
|
@ -218,9 +218,17 @@ class GitHubCopilotSetup extends BaseIdeSetup {
|
||||||
bmadSettings['chat.promptFilesRecommendations'] = options.promptRecommendations;
|
bmadSettings['chat.promptFilesRecommendations'] = options.promptRecommendations;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Merge settings (existing take precedence)
|
// Merge settings (existing take precedence, except for prompt recommendations)
|
||||||
const mergedSettings = { ...bmadSettings, ...existingSettings };
|
const mergedSettings = { ...bmadSettings, ...existingSettings };
|
||||||
|
|
||||||
|
// Deep-merge prompt recommendations (new prompts added, existing preserved)
|
||||||
|
if (options.promptRecommendations && Object.keys(options.promptRecommendations).length > 0) {
|
||||||
|
mergedSettings['chat.promptFilesRecommendations'] = {
|
||||||
|
...existingSettings['chat.promptFilesRecommendations'],
|
||||||
|
...options.promptRecommendations,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// Write settings
|
// Write settings
|
||||||
await fs.writeFile(settingsPath, JSON.stringify(mergedSettings, null, 2));
|
await fs.writeFile(settingsPath, JSON.stringify(mergedSettings, null, 2));
|
||||||
console.log(chalk.green(' ✓ VS Code settings configured'));
|
console.log(chalk.green(' ✓ VS Code settings configured'));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue