@noarka/cli 0.1.0 → 0.1.1
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/dist/cli.js +9 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5,6 +5,14 @@ import fs from "fs";
|
|
|
5
5
|
import path from "path";
|
|
6
6
|
import { createRequire } from "module";
|
|
7
7
|
var require2 = createRequire(import.meta.url);
|
|
8
|
+
function cliVersion() {
|
|
9
|
+
try {
|
|
10
|
+
const pkg = require2("../package.json");
|
|
11
|
+
return typeof pkg.version === "string" ? pkg.version : "0.0.0";
|
|
12
|
+
} catch {
|
|
13
|
+
return "0.0.0";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
8
16
|
function uiRoot() {
|
|
9
17
|
try {
|
|
10
18
|
return path.dirname(require2.resolve("@noarka/ui/package.json"));
|
|
@@ -138,7 +146,7 @@ function parseArgs(argv) {
|
|
|
138
146
|
help();
|
|
139
147
|
process.exit(0);
|
|
140
148
|
} else if (arg === "-v" || arg === "--version") {
|
|
141
|
-
console.log(
|
|
149
|
+
console.log(cliVersion());
|
|
142
150
|
process.exit(0);
|
|
143
151
|
} else if (arg.startsWith("-")) {
|
|
144
152
|
console.error(`Unknown option "${arg}". See: noarka --help`);
|