From 5fa7d2ecaad83c1509824556cc7b2156833d2cf0 Mon Sep 17 00:00:00 2001 From: Ralph Khreish <35776126+Crunchyman-ralph@users.noreply.github.com> Date: Fri, 11 Jul 2025 13:43:13 +0300 Subject: [PATCH] chore: fix format --- scripts/modules/config-manager.js | 24 ++++++++++++++++-------- src/task-master.js | 7 +++++-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/scripts/modules/config-manager.js b/scripts/modules/config-manager.js index 69ffbef4..e688897b 100644 --- a/scripts/modules/config-manager.js +++ b/scripts/modules/config-manager.js @@ -4,7 +4,10 @@ import chalk from 'chalk'; import { z } from 'zod'; import { fileURLToPath } from 'url'; import { log, findProjectRoot, resolveEnvVariable, isEmpty } from './utils.js'; -import { LEGACY_CONFIG_FILE, TASKMASTER_DIR } from '../../src/constants/paths.js'; +import { + LEGACY_CONFIG_FILE, + TASKMASTER_DIR +} from '../../src/constants/paths.js'; import { findConfigPath } from '../../src/utils/path-utils.js'; import { VALIDATED_PROVIDERS, @@ -111,11 +114,12 @@ function _loadAndValidateConfig(explicitRoot = null) { let configPath = null; let config = { ...defaults }; // Start with a deep copy of defaults let configExists = false; - + // During initialization (no project markers), skip config file search entirely - const hasProjectMarkers = fs.existsSync(path.join(rootToUse, TASKMASTER_DIR)) || - fs.existsSync(path.join(rootToUse, LEGACY_CONFIG_FILE)); - + const hasProjectMarkers = + fs.existsSync(path.join(rootToUse, TASKMASTER_DIR)) || + fs.existsSync(path.join(rootToUse, LEGACY_CONFIG_FILE)); + if (hasProjectMarkers) { // Only try to find config if we have project markers // This prevents the repeated warnings during init @@ -213,9 +217,13 @@ function _loadAndValidateConfig(explicitRoot = null) { } else { // Don't warn about missing config during initialization // Only warn if this looks like an existing project (has .taskmaster dir or legacy config marker) - const hasTaskmasterDir = fs.existsSync(path.join(rootToUse, TASKMASTER_DIR)); - const hasLegacyMarker = fs.existsSync(path.join(rootToUse, LEGACY_CONFIG_FILE)); - + const hasTaskmasterDir = fs.existsSync( + path.join(rootToUse, TASKMASTER_DIR) + ); + const hasLegacyMarker = fs.existsSync( + path.join(rootToUse, LEGACY_CONFIG_FILE) + ); + if (hasTaskmasterDir || hasLegacyMarker) { console.warn( chalk.yellow( diff --git a/src/task-master.js b/src/task-master.js index 82d493a3..3e92a4ca 100644 --- a/src/task-master.js +++ b/src/task-master.js @@ -221,9 +221,12 @@ export function initTaskMaster(overrides = {}) { // Always set default paths first // These can be overridden below if needed paths.configPath = path.join(paths.projectRoot, TASKMASTER_CONFIG_FILE); - paths.statePath = path.join(paths.taskMasterDir || path.join(paths.projectRoot, TASKMASTER_DIR), 'state.json'); + paths.statePath = path.join( + paths.taskMasterDir || path.join(paths.projectRoot, TASKMASTER_DIR), + 'state.json' + ); paths.tasksPath = path.join(paths.projectRoot, TASKMASTER_TASKS_FILE); - + // Handle overrides - only validate/resolve if explicitly provided if ('configPath' in overrides) { paths.configPath = resolvePath(