Skip to content

Commit 7cd4926

Browse files
Brian MadisonBrian Madison
authored andcommitted
project-root stutter fix
1 parent 0fa53ad commit 7cd4926

File tree

3 files changed

+44
-8
lines changed

3 files changed

+44
-8
lines changed

src/core/module.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
code: core
2+
name: "BMad™ Core Module"
3+
4+
header: "BMad™ Core Configuration"
5+
subheader: "Configure the core settings for your BMad™ installation.\nThese settings will be used across all modules and agents."
6+
7+
user_name:
8+
prompt: "What shall the agents call you (TIP: Use a team name if using with a group)?"
9+
default: "BMad"
10+
result: "{value}"
11+
12+
communication_language:
13+
prompt: "Preferred chat language/style? (English, Mandarin, English Pirate, etc...)"
14+
default: "English"
15+
result: "{value}"
16+
17+
document_output_language:
18+
prompt: "Preferred document output language?"
19+
default: "English"
20+
result: "{value}"
21+
22+
output_folder:
23+
prompt: "Where should default output files be saved unless specified in other modules?"
24+
default: "_bmad-output"
25+
result: "{project-root}/{value}"

tools/cli/installers/lib/core/config-collector.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -696,10 +696,6 @@ class ConfigCollector {
696696
for (const mod of Object.keys(this.collectedConfig)) {
697697
if (mod !== '_meta' && this.collectedConfig[mod] && this.collectedConfig[mod][configKey]) {
698698
configValue = this.collectedConfig[mod][configKey];
699-
// Extract just the value part if it's a result template
700-
if (typeof configValue === 'string' && configValue.includes('{project-root}/')) {
701-
configValue = configValue.replace('{project-root}/', '');
702-
}
703699
break;
704700
}
705701
}
@@ -813,10 +809,6 @@ class ConfigCollector {
813809
for (const mod of Object.keys(this.collectedConfig)) {
814810
if (mod !== '_meta' && this.collectedConfig[mod] && this.collectedConfig[mod][configKey]) {
815811
configValue = this.collectedConfig[mod][configKey];
816-
// Remove {project-root}/ prefix if present for cleaner display
817-
if (typeof configValue === 'string' && configValue.includes('{project-root}/')) {
818-
configValue = configValue.replace('{project-root}/', '');
819-
}
820812
break;
821813
}
822814
}

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,25 @@ class Installer {
505505
config._customFiles = customFiles;
506506
config._modifiedFiles = modifiedFiles;
507507

508+
// Preserve existing core configuration during updates
509+
// Read the current core config.yaml to maintain user's settings
510+
const coreConfigPath = path.join(bmadDir, 'core', 'config.yaml');
511+
if ((await fs.pathExists(coreConfigPath)) && (!config.coreConfig || Object.keys(config.coreConfig).length === 0)) {
512+
try {
513+
const yaml = require('yaml');
514+
const coreConfigContent = await fs.readFile(coreConfigPath, 'utf8');
515+
const existingCoreConfig = yaml.parse(coreConfigContent);
516+
517+
// Store in config.coreConfig so it's preserved through the installation
518+
config.coreConfig = existingCoreConfig;
519+
520+
// Also store in configCollector for use during config collection
521+
this.configCollector.collectedConfig.core = existingCoreConfig;
522+
} catch (error) {
523+
console.warn(chalk.yellow(`Warning: Could not read existing core config: ${error.message}`));
524+
}
525+
}
526+
508527
// Also check cache directory for custom modules (like quick update does)
509528
const cacheDir = path.join(bmadDir, '_config', 'custom');
510529
if (await fs.pathExists(cacheDir)) {

0 commit comments

Comments
 (0)