fix: added handling for complexity report path

This commit is contained in:
Shrey Paharia
2025-04-19 13:28:36 +05:30
parent dcb3f2f9f9
commit 11506ddc0e
2 changed files with 23 additions and 11 deletions

View File

@@ -672,7 +672,7 @@ function truncateString(str, maxLength) {
* Display the next task to work on
* @param {string} tasksPath - Path to the tasks.json file
*/
async function displayNextTask(tasksPath) {
async function displayNextTask(tasksPath, complexityReportPath = null) {
displayBanner();
// Read the tasks file
@@ -683,7 +683,7 @@ async function displayNextTask(tasksPath) {
}
// Read complexity report once
const complexityReport = readComplexityReport();
const complexityReport = readComplexityReport(complexityReportPath);
// Find the next task
const nextTask = findNextTask(data.tasks);
@@ -929,7 +929,7 @@ async function displayNextTask(tasksPath) {
* @param {string} tasksPath - Path to the tasks.json file
* @param {string|number} taskId - The ID of the task to display
*/
async function displayTaskById(tasksPath, taskId) {
async function displayTaskById(tasksPath, taskId, complexityReportPath = null) {
displayBanner();
// Read the tasks file
@@ -940,7 +940,7 @@ async function displayTaskById(tasksPath, taskId) {
}
// Read complexity report once
const complexityReport = readComplexityReport();
const complexityReport = readComplexityReport(complexityReportPath);
// Find the task by ID, passing the complexity report
const task = findTaskById(data.tasks, taskId, complexityReport);