fix: Clean up remaining automatic task file generation calls (#1025)
* Don't generate task files unless requested * add changeset * switch to optional generate flag instead of skip-generate based on new default * switch generate default to false and update flags and docs * revert DO/DON'T section * use simpler non ANSI-C quoting
This commit is contained in:
@@ -2655,7 +2655,7 @@ ${result.result}
|
||||
'Comma-separated list of dependency IDs for the new subtask'
|
||||
)
|
||||
.option('-s, --status <status>', 'Status for the new subtask', 'pending')
|
||||
.option('--skip-generate', 'Skip regenerating task files')
|
||||
.option('--generate', 'Regenerate task files after adding subtask')
|
||||
.option('--tag <tag>', 'Specify tag context for task operations')
|
||||
.action(async (options) => {
|
||||
// Initialize TaskMaster
|
||||
@@ -2666,7 +2666,7 @@ ${result.result}
|
||||
|
||||
const parentId = options.parent;
|
||||
const existingTaskId = options.taskId;
|
||||
const generateFiles = !options.skipGenerate;
|
||||
const generateFiles = options.generate || false;
|
||||
|
||||
// Resolve tag using standard pattern
|
||||
const tag = taskMaster.getCurrentTag();
|
||||
@@ -2816,7 +2816,7 @@ ${result.result}
|
||||
function showAddSubtaskHelp() {
|
||||
console.log(
|
||||
boxen(
|
||||
`${chalk.white.bold('Add Subtask Command Help')}\n\n${chalk.cyan('Usage:')}\n task-master add-subtask --parent=<id> [options]\n\n${chalk.cyan('Options:')}\n -p, --parent <id> Parent task ID (required)\n -i, --task-id <id> Existing task ID to convert to subtask\n -t, --title <title> Title for the new subtask\n -d, --description <text> Description for the new subtask\n --details <text> Implementation details for the new subtask\n --dependencies <ids> Comma-separated list of dependency IDs\n -s, --status <status> Status for the new subtask (default: "pending")\n -f, --file <file> Path to the tasks file (default: "${TASKMASTER_TASKS_FILE}")\n --skip-generate Skip regenerating task files\n\n${chalk.cyan('Examples:')}\n task-master add-subtask --parent=5 --task-id=8\n task-master add-subtask -p 5 -t "Implement login UI" -d "Create the login form"`,
|
||||
`${chalk.white.bold('Add Subtask Command Help')}\n\n${chalk.cyan('Usage:')}\n task-master add-subtask --parent=<id> [options]\n\n${chalk.cyan('Options:')}\n -p, --parent <id> Parent task ID (required)\n -i, --task-id <id> Existing task ID to convert to subtask\n -t, --title <title> Title for the new subtask\n -d, --description <text> Description for the new subtask\n --details <text> Implementation details for the new subtask\n --dependencies <ids> Comma-separated list of dependency IDs\n -s, --status <status> Status for the new subtask (default: "pending")\n -f, --file <file> Path to the tasks file (default: "${TASKMASTER_TASKS_FILE}")\n --generate Regenerate task files after adding subtask\n\n${chalk.cyan('Examples:')}\n task-master add-subtask --parent=5 --task-id=8\n task-master add-subtask -p 5 -t "Implement login UI" -d "Create the login form" --generate`,
|
||||
{ padding: 1, borderColor: 'blue', borderStyle: 'round' }
|
||||
)
|
||||
);
|
||||
@@ -2839,7 +2839,7 @@ ${result.result}
|
||||
'-c, --convert',
|
||||
'Convert the subtask to a standalone task instead of deleting it'
|
||||
)
|
||||
.option('--skip-generate', 'Skip regenerating task files')
|
||||
.option('--generate', 'Regenerate task files after removing subtask')
|
||||
.option('--tag <tag>', 'Specify tag context for task operations')
|
||||
.action(async (options) => {
|
||||
// Initialize TaskMaster
|
||||
@@ -2850,7 +2850,7 @@ ${result.result}
|
||||
|
||||
const subtaskIds = options.id;
|
||||
const convertToTask = options.convert || false;
|
||||
const generateFiles = !options.skipGenerate;
|
||||
const generateFiles = options.generate || false;
|
||||
const tag = taskMaster.getCurrentTag();
|
||||
|
||||
if (!subtaskIds) {
|
||||
|
||||
@@ -21,7 +21,7 @@ async function addSubtask(
|
||||
parentId,
|
||||
existingTaskId = null,
|
||||
newSubtaskData = null,
|
||||
generateFiles = true,
|
||||
generateFiles = false,
|
||||
context = {}
|
||||
) {
|
||||
const { projectRoot, tag } = context;
|
||||
|
||||
@@ -17,7 +17,7 @@ async function removeSubtask(
|
||||
tasksPath,
|
||||
subtaskId,
|
||||
convertToTask = false,
|
||||
generateFiles = true,
|
||||
generateFiles = false,
|
||||
context = {}
|
||||
) {
|
||||
const { projectRoot, tag } = context;
|
||||
@@ -111,7 +111,7 @@ async function removeSubtask(
|
||||
// Generate task files if requested
|
||||
if (generateFiles) {
|
||||
log('info', 'Regenerating task files...');
|
||||
// await generateTaskFiles(tasksPath, path.dirname(tasksPath), context);
|
||||
await generateTaskFiles(tasksPath, path.dirname(tasksPath), context);
|
||||
}
|
||||
|
||||
return convertedTask;
|
||||
|
||||
@@ -192,18 +192,18 @@ async function removeTask(tasksPath, taskIds, context = {}) {
|
||||
}
|
||||
|
||||
// Generate updated task files ONCE, with context
|
||||
try {
|
||||
await generateTaskFiles(tasksPath, path.dirname(tasksPath), {
|
||||
projectRoot,
|
||||
tag
|
||||
});
|
||||
results.messages.push('Task files regenerated successfully.');
|
||||
} catch (genError) {
|
||||
const genErrMsg = `Failed to regenerate task files: ${genError.message}`;
|
||||
results.errors.push(genErrMsg);
|
||||
results.success = false;
|
||||
log('warn', genErrMsg);
|
||||
}
|
||||
// try {
|
||||
// await generateTaskFiles(tasksPath, path.dirname(tasksPath), {
|
||||
// projectRoot,
|
||||
// tag
|
||||
// });
|
||||
// results.messages.push('Task files regenerated successfully.');
|
||||
// } catch (genError) {
|
||||
// const genErrMsg = `Failed to regenerate task files: ${genError.message}`;
|
||||
// results.errors.push(genErrMsg);
|
||||
// results.success = false;
|
||||
// log('warn', genErrMsg);
|
||||
// }
|
||||
} else if (results.errors.length === 0) {
|
||||
results.messages.push('No tasks found matching the provided IDs.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user