fix file extension transformations

This commit is contained in:
Joe Danziger
2025-05-11 15:04:54 -04:00
parent cb777ad025
commit 5710ce9747
2 changed files with 17 additions and 18 deletions

View File

@@ -219,8 +219,17 @@ function convertAllRulesToBrandRules(projectDir, profile) {
if (file.endsWith('.mdc')) {
const sourcePath = path.join(cursorRulesDir, file);
// Determine target file name (either from mapping or by replacing extension)
const targetFilename = fileMap[file] || file;
// Determine target file name
let targetFilename;
if (fileMap[file]) { // If an explicit mapping exists, use it
targetFilename = fileMap[file];
} else if (brandName === 'Roo' || brandName === 'Windsurf') {
// For Roo and Windsurf, change .mdc to .md if not in fileMap
targetFilename = file.replace(/\.mdc$/, '.md');
} else {
// For Cursor (and potentially others), keep original if not in fileMap
targetFilename = file;
}
const targetPath = path.join(brandRulesDir, targetFilename);
// Convert the file