only copy rules specifically listed in fileMap
This commit is contained in:
@@ -214,11 +214,11 @@ function convertAllRulesToBrandRules(projectDir, profile) {
|
|||||||
let success = 0;
|
let success = 0;
|
||||||
let failed = 0;
|
let failed = 0;
|
||||||
|
|
||||||
// Process each file in the Cursor rules directory
|
// Only copy files listed in fileMap (main rules folder)
|
||||||
const getTargetRuleFilename = profile.getTargetRuleFilename || ((f) => f);
|
const getTargetRuleFilename = profile.getTargetRuleFilename || ((f) => f);
|
||||||
fs.readdirSync(cursorRulesDir).forEach((file) => {
|
Object.keys(profile.fileMap).forEach((file) => {
|
||||||
if (file.endsWith('.mdc')) {
|
const sourcePath = path.join(cursorRulesDir, file);
|
||||||
const sourcePath = path.join(cursorRulesDir, file);
|
if (fs.existsSync(sourcePath)) {
|
||||||
const targetFilename = getTargetRuleFilename(file);
|
const targetFilename = getTargetRuleFilename(file);
|
||||||
const targetPath = path.join(brandRulesDir, targetFilename);
|
const targetPath = path.join(brandRulesDir, targetFilename);
|
||||||
|
|
||||||
@@ -228,6 +228,11 @@ function convertAllRulesToBrandRules(projectDir, profile) {
|
|||||||
} else {
|
} else {
|
||||||
failed++;
|
failed++;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
log(
|
||||||
|
'warn',
|
||||||
|
`File listed in fileMap not found in rules dir: ${sourcePath}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,11 @@ const rulesDir = '.cursor/rules';
|
|||||||
|
|
||||||
// File name mapping (specific files with naming changes)
|
// File name mapping (specific files with naming changes)
|
||||||
const fileMap = {
|
const fileMap = {
|
||||||
// No explicit mappings; keep original .mdc filenames
|
'cursor_rules.mdc': 'cursor_rules.mdc',
|
||||||
|
'dev_workflow.mdc': 'dev_workflow.mdc',
|
||||||
|
'self_improve.mdc': 'self_improve.mdc',
|
||||||
|
'taskmaster.mdc': 'taskmaster.mdc'
|
||||||
|
// Add other mappings as needed
|
||||||
};
|
};
|
||||||
|
|
||||||
const globalReplacements = [
|
const globalReplacements = [
|
||||||
|
|||||||
@@ -12,7 +12,10 @@ const rulesDir = '.roo/rules';
|
|||||||
|
|
||||||
// File name mapping (specific files with naming changes)
|
// File name mapping (specific files with naming changes)
|
||||||
const fileMap = {
|
const fileMap = {
|
||||||
'cursor_rules.mdc': 'roo_rules.md'
|
'cursor_rules.mdc': 'roo_rules.md',
|
||||||
|
'dev_workflow.mdc': 'dev_workflow.md',
|
||||||
|
'self_improve.mdc': 'self_improve.md',
|
||||||
|
'taskmaster.mdc': 'taskmaster.md'
|
||||||
// Add other mappings as needed
|
// Add other mappings as needed
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ const rulesDir = '.windsurf/rules';
|
|||||||
|
|
||||||
// File name mapping (specific files with naming changes)
|
// File name mapping (specific files with naming changes)
|
||||||
const fileMap = {
|
const fileMap = {
|
||||||
'cursor_rules.mdc': 'windsurf_rules.md'
|
'cursor_rules.mdc': 'windsurf_rules.md',
|
||||||
|
'dev_workflow.mdc': 'dev_workflow.md',
|
||||||
|
'self_improve.mdc': 'self_improve.md',
|
||||||
|
'taskmaster.mdc': 'taskmaster.md'
|
||||||
// Add other mappings as needed
|
// Add other mappings as needed
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user