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
This commit is contained in:
parent
6181a0bd07
commit
1a92e6823f
|
|
@ -37,18 +37,27 @@ class Installer {
|
||||||
* @param {Array} selectedModules - Selected modules from configuration
|
* @param {Array} selectedModules - Selected modules from configuration
|
||||||
* @returns {Object} Tool/IDE selection and configurations
|
* @returns {Object} Tool/IDE selection and configurations
|
||||||
*/
|
*/
|
||||||
async collectToolConfigurations(projectDir, selectedModules, isFullReinstall = false) {
|
async collectToolConfigurations(projectDir, selectedModules, isFullReinstall = false, previousIdes = []) {
|
||||||
// Prompt for tool selection
|
// Prompt for tool selection
|
||||||
const { UI } = require('../../../lib/ui');
|
const { UI } = require('../../../lib/ui');
|
||||||
const ui = new UI();
|
const ui = new UI();
|
||||||
const toolConfig = await ui.promptToolSelection(projectDir, selectedModules);
|
const toolConfig = await ui.promptToolSelection(projectDir, selectedModules);
|
||||||
|
|
||||||
// Check for already configured IDEs (but ignore them if doing a full reinstall)
|
// Check for already configured IDEs
|
||||||
const { Detector } = require('./detector');
|
const { Detector } = require('./detector');
|
||||||
const detector = new Detector();
|
const detector = new Detector();
|
||||||
const bmadDir = path.join(projectDir, 'bmad');
|
const bmadDir = path.join(projectDir, 'bmad');
|
||||||
const existingInstall = await detector.detect(bmadDir);
|
|
||||||
const previouslyConfiguredIdes = isFullReinstall ? [] : existingInstall.ides || [];
|
// During full reinstall, use the saved previous IDEs since bmad dir was deleted
|
||||||
|
// Otherwise detect from existing installation
|
||||||
|
let previouslyConfiguredIdes;
|
||||||
|
if (isFullReinstall) {
|
||||||
|
// During reinstall, treat all IDEs as new (need configuration)
|
||||||
|
previouslyConfiguredIdes = [];
|
||||||
|
} else {
|
||||||
|
const existingInstall = await detector.detect(bmadDir);
|
||||||
|
previouslyConfiguredIdes = existingInstall.ides || [];
|
||||||
|
}
|
||||||
|
|
||||||
// Collect IDE-specific configurations if any were selected
|
// Collect IDE-specific configurations if any were selected
|
||||||
const ideConfigurations = {};
|
const ideConfigurations = {};
|
||||||
|
|
@ -223,6 +232,9 @@ class Installer {
|
||||||
return { success: false, cancelled: true };
|
return { success: false, cancelled: true };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remember previously configured IDEs before deleting
|
||||||
|
config._previouslyConfiguredIdes = existingInstall.ides || [];
|
||||||
|
|
||||||
// Remove existing installation
|
// Remove existing installation
|
||||||
await fs.remove(bmadDir);
|
await fs.remove(bmadDir);
|
||||||
console.log(chalk.green('✓ Removed existing installation\n'));
|
console.log(chalk.green('✓ Removed existing installation\n'));
|
||||||
|
|
@ -296,6 +308,7 @@ class Installer {
|
||||||
path.resolve(config.directory),
|
path.resolve(config.directory),
|
||||||
config.modules,
|
config.modules,
|
||||||
config._isFullReinstall || false,
|
config._isFullReinstall || false,
|
||||||
|
config._previouslyConfiguredIdes || [],
|
||||||
);
|
);
|
||||||
|
|
||||||
// Merge tool selection into config
|
// Merge tool selection into config
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue