@actionbookdev/cli 0.5.2 → 0.5.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.
- package/bin/actionbook-darwin-arm64 +0 -0
- package/bin/actionbook-darwin-x64 +0 -0
- package/bin/actionbook-linux-arm64 +0 -0
- package/bin/actionbook-linux-x64 +0 -0
- package/bin/actionbook-win32-arm64.exe +0 -0
- package/bin/actionbook-win32-x64.exe +0 -0
- package/bin/actionbook.js +13 -1
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/actionbook-linux-x64
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/bin/actionbook.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"use strict";
|
|
11
11
|
|
|
12
12
|
const { spawn } = require("child_process");
|
|
13
|
-
const { existsSync } = require("fs");
|
|
13
|
+
const { existsSync, readFileSync } = require("fs");
|
|
14
14
|
const path = require("path");
|
|
15
15
|
|
|
16
16
|
const PLATFORMS = {
|
|
@@ -23,6 +23,14 @@ const PLATFORMS = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
function main() {
|
|
26
|
+
// Keep CLI version aligned with npm package version.
|
|
27
|
+
if (isVersionOnlyFlag(process.argv.slice(2))) {
|
|
28
|
+
const pkgPath = path.join(__dirname, "..", "package.json");
|
|
29
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
30
|
+
console.log(`actionbook ${pkg.version}`);
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
26
34
|
// Allow env var override for development
|
|
27
35
|
const envPath = process.env.ACTIONBOOK_BINARY_PATH;
|
|
28
36
|
if (envPath) {
|
|
@@ -56,6 +64,10 @@ function main() {
|
|
|
56
64
|
run(binaryPath);
|
|
57
65
|
}
|
|
58
66
|
|
|
67
|
+
function isVersionOnlyFlag(args) {
|
|
68
|
+
return args.length === 1 && (args[0] === "--version" || args[0] === "-V");
|
|
69
|
+
}
|
|
70
|
+
|
|
59
71
|
function run(binaryPath) {
|
|
60
72
|
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
61
73
|
stdio: "inherit",
|