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) <noreply@anthropic.com>
This commit is contained in:
parent
dd1a5b6256
commit
d1074c645c
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "openacp",
|
||||
"version": "0.4.4",
|
||||
"version": "0.4.6",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"bin": {
|
||||
|
||||
@ -60,14 +60,8 @@ Examples:
|
||||
}
|
||||
|
||||
export async function cmdVersion(): Promise<void> {
|
||||
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<void> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user