Compare commits

...

1 Commits

Author SHA1 Message Date
Ralph Khreish
4b540fe7da fix: displayBanner logging when silentMode is active 2025-05-03 01:04:53 +02:00
3 changed files with 69 additions and 62 deletions

View File

@@ -22,15 +22,6 @@ export async function updateTasksDirect(args, log, context = {}) {
const { session } = context; // Extract session
const { tasksJsonPath, from, prompt, research, projectRoot } = args;
// Create the standard logger wrapper
const logWrapper = {
info: (message, ...args) => log.info(message, ...args),
warn: (message, ...args) => log.warn(message, ...args),
error: (message, ...args) => log.error(message, ...args),
debug: (message, ...args) => log.debug && log.debug(message, ...args),
success: (message, ...args) => log.info(message, ...args)
};
// --- Input Validation (Keep existing checks) ---
if (!tasksJsonPath) {
log.error('updateTasksDirect called without tasksJsonPath');

View File

@@ -3,7 +3,7 @@ import chalk from 'chalk';
import boxen from 'boxen';
import Table from 'cli-table3';
import { log, readJSON, writeJSON, truncate } from '../utils.js';
import { log, readJSON, writeJSON, truncate, isSilentMode } from '../utils.js';
import { displayBanner } from '../ui.js';
import generateTaskFiles from './generate-task-files.js';
@@ -22,6 +22,7 @@ function clearSubtasks(tasksPath, taskIds) {
process.exit(1);
}
if (!isSilentMode()) {
console.log(
boxen(chalk.white.bold('Clearing Subtasks'), {
padding: 1,
@@ -30,6 +31,7 @@ function clearSubtasks(tasksPath, taskIds) {
margin: { top: 1, bottom: 1 }
})
);
}
// Handle multiple task IDs (comma-separated)
const taskIdArray = taskIds.split(',').map((id) => id.trim());
@@ -85,6 +87,7 @@ function clearSubtasks(tasksPath, taskIds) {
writeJSON(tasksPath, data);
// Show summary table
if (!isSilentMode()) {
console.log(
boxen(chalk.white.bold('Subtask Clearing Summary:'), {
padding: { left: 2, right: 2, top: 0, bottom: 0 },
@@ -94,12 +97,14 @@ function clearSubtasks(tasksPath, taskIds) {
})
);
console.log(summaryTable.toString());
}
// Regenerate task files to reflect changes
log('info', 'Regenerating task files...');
generateTaskFiles(tasksPath, path.dirname(tasksPath));
// Success message
if (!isSilentMode()) {
console.log(
boxen(
chalk.green(
@@ -129,7 +134,9 @@ function clearSubtasks(tasksPath, taskIds) {
}
)
);
}
} else {
if (!isSilentMode()) {
console.log(
boxen(chalk.yellow('No subtasks were cleared'), {
padding: 1,
@@ -140,5 +147,6 @@ function clearSubtasks(tasksPath, taskIds) {
);
}
}
}
export default clearSubtasks;

View File

@@ -9,7 +9,13 @@ import boxen from 'boxen';
import ora from 'ora';
import Table from 'cli-table3';
import gradient from 'gradient-string';
import { log, findTaskById, readJSON, truncate } from './utils.js';
import {
log,
findTaskById,
readJSON,
truncate,
isSilentMode
} from './utils.js';
import path from 'path';
import fs from 'fs';
import { findNextTask, analyzeTaskComplexity } from './task-manager.js';
@@ -23,6 +29,8 @@ const warmGradient = gradient(['#fb8b24', '#e36414', '#9a031e']);
* Display a fancy banner for the CLI
*/
function displayBanner() {
if (isSilentMode()) return;
console.clear();
const bannerText = figlet.textSync('Task Master', {
font: 'Standard',