add checks for other rules and other profile folder items before removing

This commit is contained in:
Joe Danziger
2025-05-26 23:59:59 -04:00
parent 3c23797ace
commit 3b9191c8bb
5 changed files with 802 additions and 18 deletions

View File

@@ -93,10 +93,11 @@ export async function rulesDirect(args, log, context = {}) {
const errors = removalResults.filter(
(r) => r.error && !r.success && !r.skipped
);
const withNotices = removalResults.filter((r) => r.notice);
let summary = '';
if (successes.length > 0) {
summary += `Successfully removed rules: ${successes.join(', ')}.`;
summary += `Successfully removed Task Master rules: ${successes.join(', ')}.`;
}
if (skipped.length > 0) {
summary += `Skipped (default or protected): ${skipped.join(', ')}.`;
@@ -106,6 +107,9 @@ export async function rulesDirect(args, log, context = {}) {
.map((r) => `Error removing ${r.profileName}: ${r.error}`)
.join(' ');
}
if (withNotices.length > 0) {
summary += ` Notices: ${withNotices.map((r) => `${r.profileName} - ${r.notice}`).join('; ')}.`;
}
disableSilentMode();
return {
success: errors.length === 0,