bmad_folder replacement working properly with custom and defauly modules

This commit is contained in:
Brian Madison 2025-12-07 21:58:44 -06:00
parent 86f2786dde
commit 9d7b09d065
1 changed files with 7 additions and 2 deletions

View File

@ -853,8 +853,13 @@ class ModuleManager {
// Compile with customizations if any // Compile with customizations if any
const { xml } = compileAgent(yamlContent, {}, agentName, relativePath, { config: this.coreConfig }); const { xml } = compileAgent(yamlContent, {}, agentName, relativePath, { config: this.coreConfig });
// Write the compiled MD file // Replace {bmad_folder} placeholder if needed
await fs.writeFile(targetMdPath, xml, 'utf8'); if (xml.includes('{bmad_folder}') && this.bmadFolderName) {
const processedXml = xml.replaceAll('{bmad_folder}', this.bmadFolderName);
await fs.writeFile(targetMdPath, processedXml, 'utf8');
} else {
await fs.writeFile(targetMdPath, xml, 'utf8');
}
// Copy sidecar files if agent has hasSidecar flag // Copy sidecar files if agent has hasSidecar flag
if (hasSidecar) { if (hasSidecar) {