Skip to content

Commit 1a92e68

Browse files
Brian MadisonBrian Madison
authored andcommitted
fix: ensure IDE configurations are collected during full reinstall
- Remember previously configured IDEs before deleting bmad directory - During full reinstall, treat all selected IDEs as newly selected - Properly prompt for IDE configuration questions during reinstall - Remove debug logging
1 parent 6181a0b commit 1a92e68

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

tools/cli/installers/lib/core/installer.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,27 @@ class Installer {
3737
* @param {Array} selectedModules - Selected modules from configuration
3838
* @returns {Object} Tool/IDE selection and configurations
3939
*/
40-
async collectToolConfigurations(projectDir, selectedModules, isFullReinstall = false) {
40+
async collectToolConfigurations(projectDir, selectedModules, isFullReinstall = false, previousIdes = []) {
4141
// Prompt for tool selection
4242
const { UI } = require('../../../lib/ui');
4343
const ui = new UI();
4444
const toolConfig = await ui.promptToolSelection(projectDir, selectedModules);
4545

46-
// Check for already configured IDEs (but ignore them if doing a full reinstall)
46+
// Check for already configured IDEs
4747
const { Detector } = require('./detector');
4848
const detector = new Detector();
4949
const bmadDir = path.join(projectDir, 'bmad');
50-
const existingInstall = await detector.detect(bmadDir);
51-
const previouslyConfiguredIdes = isFullReinstall ? [] : existingInstall.ides || [];
50+
51+
// During full reinstall, use the saved previous IDEs since bmad dir was deleted
52+
// Otherwise detect from existing installation
53+
let previouslyConfiguredIdes;
54+
if (isFullReinstall) {
55+
// During reinstall, treat all IDEs as new (need configuration)
56+
previouslyConfiguredIdes = [];
57+
} else {
58+
const existingInstall = await detector.detect(bmadDir);
59+
previouslyConfiguredIdes = existingInstall.ides || [];
60+
}
5261

5362
// Collect IDE-specific configurations if any were selected
5463
const ideConfigurations = {};
@@ -223,6 +232,9 @@ class Installer {
223232
return { success: false, cancelled: true };
224233
}
225234

235+
// Remember previously configured IDEs before deleting
236+
config._previouslyConfiguredIdes = existingInstall.ides || [];
237+
226238
// Remove existing installation
227239
await fs.remove(bmadDir);
228240
console.log(chalk.green('✓ Removed existing installation\n'));
@@ -296,6 +308,7 @@ class Installer {
296308
path.resolve(config.directory),
297309
config.modules,
298310
config._isFullReinstall || false,
311+
config._previouslyConfiguredIdes || [],
299312
);
300313

301314
// Merge tool selection into config

0 commit comments

Comments
 (0)