Fix CLI --force flag on parse-prd command

This commit is contained in:
Joe Danziger
2025-05-13 16:06:09 -04:00
committed by GitHub
parent 0527c363e3
commit 4117f71c18
2 changed files with 11 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
---
'task-master-ai': patch
---
Fix CLI --force flag for parse-prd command
Previously, the --force flag was not respected when running `parse-prd`, causing the command to prompt for confirmation or fail even when --force was provided. This patch ensures that the flag is correctly passed and handled, allowing users to overwrite existing tasks.json files as intended.
- Fixes #477

View File

@@ -515,7 +515,7 @@ function registerCommands(programInstance) {
const outputPath = options.output; const outputPath = options.output;
const force = options.force || false; const force = options.force || false;
const append = options.append || false; const append = options.append || false;
let useForce = false; let useForce = force;
let useAppend = false; let useAppend = false;
// Helper function to check if tasks.json exists and confirm overwrite // Helper function to check if tasks.json exists and confirm overwrite
@@ -609,7 +609,7 @@ function registerCommands(programInstance) {
spinner = ora('Parsing PRD and generating tasks...').start(); spinner = ora('Parsing PRD and generating tasks...').start();
await parsePRD(inputFile, outputPath, numTasks, { await parsePRD(inputFile, outputPath, numTasks, {
append: useAppend, append: useAppend,
force: useForce useForce
}); });
spinner.succeed('Tasks generated successfully!'); spinner.succeed('Tasks generated successfully!');
} catch (error) { } catch (error) {