fix: check package.json for app version (#1160) (#1182)

This commit is contained in:
Brandon Keiji
2025-06-18 09:57:17 -07:00
committed by GitHub
parent 3453b977b8
commit 30d1662128
4 changed files with 13 additions and 10 deletions

View File

@@ -4,6 +4,9 @@
* SPDX-License-Identifier: Apache-2.0
*/
export function getCliVersion(): string {
return process.env.CLI_VERSION || 'unknown';
import { getPackageJson } from './package.js';
export async function getCliVersion(): Promise<string> {
const pkgJson = await getPackageJson();
return process.env.CLI_VERSION || pkgJson?.version || 'unknown';
}