chore: fix formatting issues
This commit is contained in:
@@ -1404,12 +1404,18 @@ function registerCommands(programInstance) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Split task IDs if comma-separated
|
// Split task IDs if comma-separated
|
||||||
const taskIdArray = taskIds.split(',').map(id => id.trim());
|
const taskIdArray = taskIds.split(',').map((id) => id.trim());
|
||||||
|
|
||||||
// Validate all task IDs exist before proceeding
|
// Validate all task IDs exist before proceeding
|
||||||
const invalidTasks = taskIdArray.filter(id => !taskExists(data.tasks, id));
|
const invalidTasks = taskIdArray.filter(
|
||||||
|
(id) => !taskExists(data.tasks, id)
|
||||||
|
);
|
||||||
if (invalidTasks.length > 0) {
|
if (invalidTasks.length > 0) {
|
||||||
console.error(chalk.red(`Error: The following tasks were not found: ${invalidTasks.join(', ')}`));
|
console.error(
|
||||||
|
chalk.red(
|
||||||
|
`Error: The following tasks were not found: ${invalidTasks.join(', ')}`
|
||||||
|
)
|
||||||
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1452,7 +1458,8 @@ function registerCommands(programInstance) {
|
|||||||
// Show if other tasks depend on it
|
// Show if other tasks depend on it
|
||||||
const dependentTasks = data.tasks.filter(
|
const dependentTasks = data.tasks.filter(
|
||||||
(t) =>
|
(t) =>
|
||||||
t.dependencies && t.dependencies.includes(parseInt(taskId, 10))
|
t.dependencies &&
|
||||||
|
t.dependencies.includes(parseInt(taskId, 10))
|
||||||
);
|
);
|
||||||
|
|
||||||
if (dependentTasks.length > 0) {
|
if (dependentTasks.length > 0) {
|
||||||
@@ -1461,7 +1468,9 @@ function registerCommands(programInstance) {
|
|||||||
`⚠️ Warning: ${dependentTasks.length} other tasks depend on this task!`
|
`⚠️ Warning: ${dependentTasks.length} other tasks depend on this task!`
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
console.log(chalk.yellow('These dependencies will be removed:'));
|
console.log(
|
||||||
|
chalk.yellow('These dependencies will be removed:')
|
||||||
|
);
|
||||||
dependentTasks.forEach((t) => {
|
dependentTasks.forEach((t) => {
|
||||||
console.log(chalk.yellow(` - Task ${t.id}: ${t.title}`));
|
console.log(chalk.yellow(` - Task ${t.id}: ${t.title}`));
|
||||||
});
|
});
|
||||||
@@ -1504,8 +1513,8 @@ function registerCommands(programInstance) {
|
|||||||
stopLoadingIndicator(indicator);
|
stopLoadingIndicator(indicator);
|
||||||
|
|
||||||
// Display results
|
// Display results
|
||||||
const successfulRemovals = results.filter(r => r.success);
|
const successfulRemovals = results.filter((r) => r.success);
|
||||||
const failedRemovals = results.filter(r => !r.success);
|
const failedRemovals = results.filter((r) => !r.success);
|
||||||
|
|
||||||
if (successfulRemovals.length > 0) {
|
if (successfulRemovals.length > 0) {
|
||||||
console.log(
|
console.log(
|
||||||
@@ -1514,9 +1523,13 @@ function registerCommands(programInstance) {
|
|||||||
`Successfully removed ${successfulRemovals.length} task${successfulRemovals.length > 1 ? 's' : ''}`
|
`Successfully removed ${successfulRemovals.length} task${successfulRemovals.length > 1 ? 's' : ''}`
|
||||||
) +
|
) +
|
||||||
'\n\n' +
|
'\n\n' +
|
||||||
successfulRemovals.map(r =>
|
successfulRemovals
|
||||||
chalk.white(`✓ ${r.taskId.includes('.') ? 'Subtask' : 'Task'} ${r.taskId}`)
|
.map((r) =>
|
||||||
).join('\n'),
|
chalk.white(
|
||||||
|
`✓ ${r.taskId.includes('.') ? 'Subtask' : 'Task'} ${r.taskId}`
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.join('\n'),
|
||||||
{
|
{
|
||||||
padding: 1,
|
padding: 1,
|
||||||
borderColor: 'green',
|
borderColor: 'green',
|
||||||
@@ -1534,9 +1547,9 @@ function registerCommands(programInstance) {
|
|||||||
`Failed to remove ${failedRemovals.length} task${failedRemovals.length > 1 ? 's' : ''}`
|
`Failed to remove ${failedRemovals.length} task${failedRemovals.length > 1 ? 's' : ''}`
|
||||||
) +
|
) +
|
||||||
'\n\n' +
|
'\n\n' +
|
||||||
failedRemovals.map(r =>
|
failedRemovals
|
||||||
chalk.white(`✗ ${r.taskId}: ${r.error}`)
|
.map((r) => chalk.white(`✗ ${r.taskId}: ${r.error}`))
|
||||||
).join('\n'),
|
.join('\n'),
|
||||||
{
|
{
|
||||||
padding: 1,
|
padding: 1,
|
||||||
borderColor: 'red',
|
borderColor: 'red',
|
||||||
|
|||||||
Reference in New Issue
Block a user