ability-cli 0.2.1 → 0.2.2
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/index.js +10 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
4
|
import { Command } from "commander";
|
|
5
|
+
import { readFileSync } from "fs";
|
|
6
|
+
import { dirname, join } from "path";
|
|
7
|
+
import { fileURLToPath } from "url";
|
|
5
8
|
|
|
6
9
|
// src/config.ts
|
|
7
10
|
import fs from "fs";
|
|
@@ -462,7 +465,13 @@ function registerDoctorCommand(program2) {
|
|
|
462
465
|
|
|
463
466
|
// src/index.ts
|
|
464
467
|
var program = new Command();
|
|
465
|
-
|
|
468
|
+
function readPackageVersion() {
|
|
469
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
470
|
+
const pkgPath = join(here, "..", "package.json");
|
|
471
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
472
|
+
return pkg.version ?? "0.0.0";
|
|
473
|
+
}
|
|
474
|
+
program.name("ability-cli").description("\u539F\u5B50\u80FD\u529B\u5E73\u53F0 CLI \u5DE5\u5177").version(readPackageVersion()).option("--env <env>", "\u73AF\u5883 (test/prod)").option("--app-id <id>", "zy-app-id").option("--app-secret <secret>", "appSecret").option("--auth-token <token>", "Authorization").option("--base-url <url>", "\u7F51\u5173\u5730\u5740").option("--magic-sign", "\u6D4B\u8BD5\u73AF\u5883\u8DF3\u8FC7\u9A8C\u7B7E").option("-v, --verbose", "\u8BE6\u7EC6\u8F93\u51FA");
|
|
466
475
|
registerConfigCommand(program);
|
|
467
476
|
registerRawCommand(program);
|
|
468
477
|
registerSearchCommand(program);
|