Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/task-master.js
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this change, think its important

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const __dirname = dirname(__filename);
const require = createRequire(import.meta.url);

// Get package information
const packageJson = require('../package.json');
// Use a more reliable path to find the package.json
const packageJsonPath = resolve(__dirname, '../package.json');
const packageJson = require(packageJsonPath);
const version = packageJson.version;

// Get paths to script files
Expand Down
2 changes: 1 addition & 1 deletion package.json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this, will be fixed separetly, its due to a different issue

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "task-master-ai",
"version": "0.9.30",
"version": "0.10.2",
"description": "A task management system for ambitious AI-driven development that doesn't overwhelm and confuse Cursor.",
"main": "index.js",
"type": "module",
Expand Down
20 changes: 18 additions & 2 deletions scripts/modules/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,32 @@ function displayBanner() {
// Add creator credit line below the banner
console.log(chalk.dim('by ') + chalk.cyan.underline('https://x.com/eyaltoledano'));

// Read version directly from package.json
// Read version from the task-master package.json, not the current directory
let version = CONFIG.projectVersion; // Default fallback
try {
const packageJsonPath = path.join(process.cwd(), 'package.json');
// First try to find the package's own directory (more reliable)
const packagePath = path.resolve(__dirname, '../../..');
const packageJsonPath = path.join(packagePath, 'package.json');

if (fs.existsSync(packageJsonPath)) {
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
version = packageJson.version;
} else {
// Fallback to current directory only if we couldn't find the package's own package.json
const cwdPackageJsonPath = path.join(process.cwd(), 'package.json');
if (fs.existsSync(cwdPackageJsonPath)) {
const cwdPackageJson = JSON.parse(fs.readFileSync(cwdPackageJsonPath, 'utf8'));
// Only use the current directory's version if it's actually task-master-ai
if (cwdPackageJson.name === 'task-master-ai') {
version = cwdPackageJson.version;
}
}
}
} catch (error) {
// Silently fall back to default version
if (CONFIG.debug) {
console.error('Error reading package version:', error);
}
}

console.log(boxen(chalk.white(`${chalk.bold('Version:')} ${version} ${chalk.bold('Project:')} ${CONFIG.projectName}`), {
Expand Down
2 changes: 1 addition & 1 deletion scripts/modules/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const CONFIG = {
defaultSubtasks: parseInt(process.env.DEFAULT_SUBTASKS || "3"),
defaultPriority: process.env.DEFAULT_PRIORITY || "medium",
projectName: process.env.PROJECT_NAME || "Task Master",
projectVersion: "1.5.0" // Hardcoded version - ALWAYS use this value, ignore environment variable
projectVersion: process.env.PROJECT_VERSION || "0.10.2" // Default fallback, should match package.json
};

// Set up logging based on log level
Expand Down