fix: harden document workflow choices and config path handling
This commit is contained in:
parent
197c0f185b
commit
ee7f5a8969
|
|
@ -2,7 +2,7 @@
|
|||
name: dev-story
|
||||
description: "Execute a story by implementing tasks/subtasks, writing tests, validating, and updating the story file per acceptance criteria"
|
||||
projectRoot: '{project-root}'
|
||||
main_config: '{projectRoot}/_bmad/bmm/config.yaml'
|
||||
main_config: '{project-root}/_bmad/bmm/config.yaml'
|
||||
web_bundle: false
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -163,6 +163,11 @@ Your choice [1/2/3]:
|
|||
<action>Exit workflow</action>
|
||||
</check>
|
||||
|
||||
<check if="user input is not 1, 2, or 3">
|
||||
<output>Invalid selection. Expected 1, 2, or 3. Exiting workflow without changes.</output>
|
||||
<action>Exit workflow</action>
|
||||
</check>
|
||||
|
||||
</check>
|
||||
</check>
|
||||
|
||||
|
|
@ -220,6 +225,11 @@ Your choice [1/2/3]:
|
|||
<action>Display message: "Keeping existing documentation. Exiting workflow."</action>
|
||||
<action>Exit workflow</action>
|
||||
</check>
|
||||
|
||||
<check if="user input is not 1, 2, or 3">
|
||||
<output>Invalid selection. Expected 1, 2, or 3. Exiting workflow without changes.</output>
|
||||
<action>Exit workflow</action>
|
||||
</check>
|
||||
</check>
|
||||
|
||||
<check if="index.md does not exist">
|
||||
|
|
|
|||
|
|
@ -810,6 +810,8 @@ class ModuleManager {
|
|||
return content;
|
||||
}
|
||||
|
||||
const newline = frontmatterMatch[0].includes('\r\n') ? '\r\n' : '\n';
|
||||
|
||||
try {
|
||||
const yaml = require('yaml');
|
||||
const parsed = yaml.parse(frontmatterMatch[1]);
|
||||
|
|
@ -827,7 +829,8 @@ class ModuleManager {
|
|||
})
|
||||
.trimEnd();
|
||||
|
||||
return content.replace(frontmatterMatch[0], `---\n${serialized}\n---`);
|
||||
const normalized = newline === '\r\n' ? serialized.replaceAll('\n', '\r\n') : serialized;
|
||||
return content.replace(frontmatterMatch[0], `---${newline}${normalized}${newline}---`);
|
||||
} catch (error) {
|
||||
console.warn(`Warning: Failed to parse workflow frontmatter for web_bundle removal: ${error.message}`);
|
||||
return content;
|
||||
|
|
|
|||
Loading…
Reference in New Issue