Skip to content

Commit 86f7c38

Browse files
committed
fix: read CLI version from package.json dynamically
Previously the version was hardcoded in cli.ts causing mismatch with the actual package version. Now reads from package.json at runtime to ensure consistency.
1 parent 7494ef6 commit 86f7c38

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cardmagic/notes",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "CLI and MCP server to search and browse Apple Notes",
55
"author": {
66
"name": "Lucas Carlson"

src/cli.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
import { Command } from 'commander';
2+
import { readFileSync } from 'node:fs';
3+
import { fileURLToPath } from 'node:url';
4+
import { dirname, join } from 'node:path';
5+
6+
const __dirname = dirname(fileURLToPath(import.meta.url));
7+
const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8'));
28
import { buildIndex, updateIndex, indexNeedsRebuild } from './indexer.js';
39
import {
410
searchNotes,
@@ -23,7 +29,7 @@ const program = new Command();
2329
program
2430
.name('notes')
2531
.description('CLI tool to search and browse Apple Notes')
26-
.version('1.0.0');
32+
.version(pkg.version);
2733

2834
program
2935
.command('search <query>')

0 commit comments

Comments
 (0)