allow multiples
This commit is contained in:
@@ -503,7 +503,9 @@ function registerCommands(programInstance) {
|
|||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const brand of brands) {
|
// Support both space- and comma-separated brand lists
|
||||||
|
const expandedBrands = brands.flatMap(b => b.split(',').map(s => s.trim())).filter(Boolean);
|
||||||
|
for (const brand of expandedBrands) {
|
||||||
let profile;
|
let profile;
|
||||||
try {
|
try {
|
||||||
// Use pathToFileURL for correct ESM dynamic import
|
// Use pathToFileURL for correct ESM dynamic import
|
||||||
@@ -520,9 +522,15 @@ function registerCommands(programInstance) {
|
|||||||
if (action === 'add') {
|
if (action === 'add') {
|
||||||
const { convertAllCursorRulesToBrandRules } = await import('./rule-transformer.js');
|
const { convertAllCursorRulesToBrandRules } = await import('./rule-transformer.js');
|
||||||
convertAllCursorRulesToBrandRules(projectDir, profile);
|
convertAllCursorRulesToBrandRules(projectDir, profile);
|
||||||
|
if (typeof profile.onAddBrandRules === 'function') {
|
||||||
|
profile.onAddBrandRules(projectDir);
|
||||||
|
}
|
||||||
} else if (action === 'remove') {
|
} else if (action === 'remove') {
|
||||||
const { removeBrandRules } = await import('./rule-transformer.js');
|
const { removeBrandRules } = await import('./rule-transformer.js');
|
||||||
removeBrandRules(projectDir, profile);
|
removeBrandRules(projectDir, profile);
|
||||||
|
if (typeof profile.onRemoveBrandRules === 'function') {
|
||||||
|
profile.onRemoveBrandRules(projectDir);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error('Unknown action. Use "add" or "remove".');
|
console.error('Unknown action. Use "add" or "remove".');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user