diff --git a/test/test-installation-components.js b/test/test-installation-components.js index b3736c0a7..b0bded006 100644 --- a/test/test-installation-components.js +++ b/test/test-installation-components.js @@ -32,8 +32,9 @@ let failed = 0; /** * Recursively collect files from a mix of files/directories. */ -async function collectFiles(targets, allowedExtensions) { +async function collectFiles(targets, allowedExtensions, excludedFiles = new Set()) { const files = []; + const normalizedExcludes = new Set([...excludedFiles].map((p) => path.resolve(p))); const walk = async (targetPath) => { if (!(await fs.pathExists(targetPath))) { @@ -42,6 +43,10 @@ async function collectFiles(targets, allowedExtensions) { const stat = await fs.stat(targetPath); if (stat.isFile()) { + const normalizedTargetPath = path.resolve(targetPath); + if (normalizedExcludes.has(normalizedTargetPath)) { + return; + } if (allowedExtensions.has(path.extname(targetPath))) { files.push(targetPath); } @@ -58,6 +63,9 @@ async function collectFiles(targets, allowedExtensions) { await walk(fullPath); continue; } + if (normalizedExcludes.has(path.resolve(fullPath))) { + continue; + } if (allowedExtensions.has(path.extname(entry.name))) { files.push(fullPath); } @@ -273,9 +281,10 @@ async function runTests() { ]; const allowedExtensions = new Set(['.md', '.yaml', '.yml', '.xml']); const forbiddenRef = 'validate-workflow.xml'; + const excludedFile = path.join(projectRoot, 'src', 'core', 'tasks', 'validate-workflow.xml'); const offenders = []; - const files = await collectFiles(searchTargets, allowedExtensions); + const files = await collectFiles(searchTargets, allowedExtensions, new Set([excludedFile])); for (const fullPath of files) { const content = await fs.readFile(fullPath, 'utf8'); if (content.includes(forbiddenRef)) { diff --git a/tools/cli/installers/lib/ide/shared/agent-command-generator.js b/tools/cli/installers/lib/ide/shared/agent-command-generator.js index 0915c306b..233214806 100644 --- a/tools/cli/installers/lib/ide/shared/agent-command-generator.js +++ b/tools/cli/installers/lib/ide/shared/agent-command-generator.js @@ -79,8 +79,7 @@ class AgentCommandGenerator { .replaceAll('{{module}}', agent.module) .replaceAll('{{path}}', agentPathInModule) .replaceAll('{{description}}', agent.description || `${agent.name} agent`) - .replaceAll('_bmad', this.bmadFolderName) - .replaceAll('_bmad', '_bmad'); + .replaceAll('_bmad', this.bmadFolderName); } /**