Compare commits

...

1 Commits

Author SHA1 Message Date
Ralph Khreish
a673df87bc fix: issues with release
Fix remove-task bug with mcp
Fix response-language using old config file .taskmaster
2025-07-03 14:22:16 +03:00
2 changed files with 18 additions and 25 deletions

View File

@@ -101,8 +101,7 @@ export async function removeTaskDirect(args, log, context = {}) {
success: false, success: false,
error: { error: {
code: 'REMOVE_TASK_ERROR', code: 'REMOVE_TASK_ERROR',
message: result.errors.join('; ') || 'Failed to remove tasks', message: result.error || 'Failed to remove tasks'
details: result.errors
} }
}; };
} }
@@ -114,10 +113,9 @@ export async function removeTaskDirect(args, log, context = {}) {
data: { data: {
totalTasks: taskIdArray.length, totalTasks: taskIdArray.length,
successful: result.removedTasks.length, successful: result.removedTasks.length,
failed: result.errors.length, failed: taskIdArray.length - result.removedTasks.length,
removedTasks: result.removedTasks, removedTasks: result.removedTasks,
messages: result.messages, message: result.message,
errors: result.errors,
tasksPath: tasksJsonPath, tasksPath: tasksJsonPath,
tag: data.tag || tag || 'master' tag: data.tag || tag || 'master'
} }

View File

@@ -1,10 +1,10 @@
import path from 'path';
import fs from 'fs';
import { import {
getConfig, getConfig,
isConfigFilePresent, isConfigFilePresent,
writeConfig writeConfig
} from '../config-manager.js'; } from '../config-manager.js';
import { findConfigPath } from '../../../src/utils/path-utils.js';
import { log } from '../utils.js';
function setResponseLanguage(lang, options = {}) { function setResponseLanguage(lang, options = {}) {
const { mcpLog, projectRoot } = options; const { mcpLog, projectRoot } = options;
@@ -15,23 +15,18 @@ function setResponseLanguage(lang, options = {}) {
} }
}; };
let configPath; // Use centralized config path finding instead of hardcoded path
let configExists = false; const configPath = findConfigPath(null, { projectRoot });
const configExists = isConfigFilePresent(projectRoot);
if (projectRoot) { log(
configPath = path.join(projectRoot, '.taskmasterconfig'); 'debug',
configExists = fs.existsSync(configPath); `Checking for config file using findConfigPath, found: ${configPath}`
report(
'info',
`Checking for .taskmasterconfig at: ${configPath}, exists: ${configExists}`
); );
} else { log(
configExists = isConfigFilePresent(); 'debug',
report( `Checking config file using isConfigFilePresent(), exists: ${configExists}`
'info',
`Checking for .taskmasterconfig using isConfigFilePresent(), exists: ${configExists}`
); );
}
if (!configExists) { if (!configExists) {
return { return {
@@ -39,7 +34,7 @@ function setResponseLanguage(lang, options = {}) {
error: { error: {
code: 'CONFIG_MISSING', code: 'CONFIG_MISSING',
message: message:
'The .taskmasterconfig file is missing. Run "task-master models --setup" to create it.' 'The configuration file is missing. Run "task-master models --setup" to create it.'
} }
}; };
} }
@@ -65,7 +60,7 @@ function setResponseLanguage(lang, options = {}) {
success: false, success: false,
error: { error: {
code: 'WRITE_ERROR', code: 'WRITE_ERROR',
message: 'Error writing updated configuration to .taskmasterconfig' message: 'Error writing updated configuration to configuration file'
} }
}; };
} }