fix(create-story): update converted workflow path refs

This commit is contained in:
Alex Verkhovsky 2026-03-12 22:49:08 -06:00
parent 63842b47e6
commit 234ae70ae0
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@ const INSTALL_REGEX = /\{project-root\}\/(?:_bmad)\/([^/]+)\/workflows\/(.+)/;
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Test data // Test data
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
const sourcePath = '{project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md'; const sourcePath = '{project-root}/_bmad/bmm/workflows/4-implementation/bmad-create-story/workflow.md';
const installPath = '{project-root}/_bmad/bmgd/workflows/4-production/create-story/workflow.md'; const installPath = '{project-root}/_bmad/bmgd/workflows/4-production/create-story/workflow.md';
console.log(`\n${colors.cyan}Workflow Path Regex Tests${colors.reset}\n`); console.log(`\n${colors.cyan}Workflow Path Regex Tests${colors.reset}\n`);
@ -63,9 +63,9 @@ assert(
`Expected "bmm", got "${sourceMatch && sourceMatch[1]}"`, `Expected "bmm", got "${sourceMatch && sourceMatch[1]}"`,
); );
assert( assert(
sourceMatch && sourceMatch[2] === '4-implementation/create-story/workflow.md', sourceMatch && sourceMatch[2] === '4-implementation/bmad-create-story/workflow.md',
'Source regex group [2] is the workflow sub-path', 'Source regex group [2] is the workflow sub-path',
`Expected "4-implementation/create-story/workflow.md", got "${sourceMatch && sourceMatch[2]}"`, `Expected "4-implementation/bmad-create-story/workflow.md", got "${sourceMatch && sourceMatch[2]}"`,
); );
// --- Install regex tests (group [2] returns module name, not sub-path) --- // --- Install regex tests (group [2] returns module name, not sub-path) ---

View File

@ -1077,7 +1077,7 @@ class ModuleManager {
const installWorkflowPath = item['workflow-install']; // Where to copy TO const installWorkflowPath = item['workflow-install']; // Where to copy TO
// Parse SOURCE workflow path // Parse SOURCE workflow path
// Example: {project-root}/_bmad/bmm/workflows/4-implementation/create-story/workflow.md // Example: {project-root}/_bmad/bmm/workflows/4-implementation/bmad-create-story/workflow.md
const sourceMatch = sourceWorkflowPath.match(/\{project-root\}\/(?:_bmad)\/([^/]+)\/workflows\/(.+)/); const sourceMatch = sourceWorkflowPath.match(/\{project-root\}\/(?:_bmad)\/([^/]+)\/workflows\/(.+)/);
if (!sourceMatch) { if (!sourceMatch) {
await prompts.log.warn(` Could not parse workflow path: ${sourceWorkflowPath}`); await prompts.log.warn(` Could not parse workflow path: ${sourceWorkflowPath}`);