From d1074c645cd91d4fad51fa00a3175d80f9eab9ec Mon Sep 17 00:00:00 2001 From: 0xmrpeter <0xmrpeter@gmail.com> Date: Sun, 22 Mar 2026 01:41:16 +0700 Subject: [PATCH] fix: resolve --version showing 0.0.0-dev when installed globally Use getCurrentVersion() which walks up directories to find package.json instead of hardcoded relative path that fails in global installs. Bump version to 0.4.6. Co-Authored-By: Claude Opus 4.6 (1M context) --- package.json | 2 +- src/cli/commands.ts | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index c2adeee..4ac29f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openacp", - "version": "0.4.4", + "version": "0.4.6", "private": true, "type": "module", "bin": { diff --git a/src/cli/commands.ts b/src/cli/commands.ts index 8f5205d..fd2271d 100644 --- a/src/cli/commands.ts +++ b/src/cli/commands.ts @@ -60,14 +60,8 @@ Examples: } export async function cmdVersion(): Promise { - try { - const { createRequire } = await import("node:module") - const require = createRequire(import.meta.url) - const pkg = require("../../package.json") - console.log(`openacp v${pkg.version}`) - } catch { - console.log("openacp v0.0.0-dev") - } + const { getCurrentVersion } = await import("./version.js") + console.log(`openacp v${getCurrentVersion()}`) } export async function cmdInstall(args: string[]): Promise {