novaui-cli 1.1.1 → 1.1.3

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.
@@ -0,0 +1,17 @@
1
+ import fs from 'node:fs'
2
+ import path from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
+
5
+ const __filename = fileURLToPath(import.meta.url)
6
+ const __dirname = path.dirname(__filename)
7
+
8
+ const CLI_PACKAGE_JSON_PATH = path.resolve(__dirname, '../../package.json')
9
+
10
+ export function getCliVersion() {
11
+ try {
12
+ const pkg = JSON.parse(fs.readFileSync(CLI_PACKAGE_JSON_PATH, 'utf8'))
13
+ return pkg.version || 'unknown'
14
+ } catch {
15
+ return 'unknown'
16
+ }
17
+ }