From 4117f71c18ee4d321a9c91308d00d5d69bfac61e Mon Sep 17 00:00:00 2001 From: Joe Danziger Date: Tue, 13 May 2025 16:06:09 -0400 Subject: [PATCH] Fix CLI --force flag on parse-prd command --- .changeset/floppy-plants-marry.md | 9 +++++++++ scripts/modules/commands.js | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/floppy-plants-marry.md diff --git a/.changeset/floppy-plants-marry.md b/.changeset/floppy-plants-marry.md new file mode 100644 index 00000000..401fed18 --- /dev/null +++ b/.changeset/floppy-plants-marry.md @@ -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 \ No newline at end of file diff --git a/scripts/modules/commands.js b/scripts/modules/commands.js index 21870f74..0e60642b 100644 --- a/scripts/modules/commands.js +++ b/scripts/modules/commands.js @@ -515,7 +515,7 @@ function registerCommands(programInstance) { const outputPath = options.output; const force = options.force || false; const append = options.append || false; - let useForce = false; + let useForce = force; let useAppend = false; // 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(); await parsePRD(inputFile, outputPath, numTasks, { append: useAppend, - force: useForce + useForce }); spinner.succeed('Tasks generated successfully!'); } catch (error) {