baton-issue-tracker 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baton-issue-tracker",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "A CLI issue tracker for AI agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,4 +1,5 @@
1
1
  import Database from "better-sqlite3";
2
+ import { fileURLToPath } from 'url';
2
3
  import { drizzle } from "drizzle-orm/better-sqlite3";
3
4
  import { migrate } from "drizzle-orm/better-sqlite3/migrator";
4
5
  import fs from "fs";
@@ -6,6 +7,9 @@ import path from "path";
6
7
 
7
8
  import * as schema from "../models/schema.js";
8
9
 
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+
9
13
  const dataDir = path.join(process.cwd(), ".baton");
10
14
  const dbPath = path.join(dataDir, "baton.db");
11
15
 
@@ -23,7 +27,7 @@ let db = drizzle(sqliteConnection, { schema });
23
27
  export function initDB() {
24
28
  // Apply Migrations dynamically on CLI startup
25
29
  // This looks for a folder named "drizzle" in your project root
26
- const migrationsFolder = path.join(process.cwd(), "drizzle");
30
+ const migrationsFolder = path.join(__dirname, '../../drizzle');
27
31
 
28
32
  if (fs.existsSync(migrationsFolder)) {
29
33
  migrate(db, { migrationsFolder });