fix(installer): improve dynamic bmad folder name extraction from config

- Updated the installer to load existing configuration for bmad folder name, ensuring consistency across installation flows.
- Implemented fallback logic to derive the folder name from the path or default to 'bmad' if no config is available.
- Enhanced integration with module and IDE managers to utilize the dynamically determined folder name.
This commit is contained in:
Phil Mahncke 2025-11-12 11:50:28 -05:00
parent 79ef3b5431
commit 621a5d12db
1 changed files with 7 additions and 4 deletions

View File

@ -1560,10 +1560,13 @@ class Installer {
throw new Error(`BMAD not installed at ${bmadDir}`);
}
// Extract bmad folder name from the directory path and set it on managers
// This ensures generated IDE commands use the correct folder name (e.g., .bmad vs bmad)
const bmadFolderName = path.basename(bmadDir);
this.bmadFolderName = bmadFolderName; // Store for use in other methods
// Load existing config to get bmad_folder (consistent with install() and quickUpdate() flows)
await this.configCollector.loadExistingConfig(projectDir);
// Extract bmad folder name from config (consistent with other installer flows)
// Fallback to path basename if config not available, then to 'bmad' as last resort
this.bmadFolderName =
this.configCollector.existingConfig?.core?.bmad_folder || this.configCollector.collectedConfig?.core?.bmad_folder || 'bmad';
this.moduleManager.setBmadFolderName(bmadFolderName);
this.ideManager.setBmadFolderName(bmadFolderName);