@ihr360cli/ihr-cli 1.0.44 → 1.0.45-beta.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/bin/ihr-cli.js +20 -6
- package/package.json +6 -6
package/bin/ihr-cli.js
CHANGED
|
@@ -5,14 +5,28 @@ const { spawnSync } = require("child_process");
|
|
|
5
5
|
const fs = require("fs");
|
|
6
6
|
const path = require("path");
|
|
7
7
|
|
|
8
|
-
const
|
|
8
|
+
const DEFAULT_ROOT_PACKAGE_NAME = "@ihr360cli/ihr-cli";
|
|
9
|
+
|
|
10
|
+
function rootPackageName() {
|
|
11
|
+
try {
|
|
12
|
+
const manifest = require("../package.json");
|
|
13
|
+
const name = String(manifest.name || "").trim();
|
|
14
|
+
if (/^@[a-z0-9][a-z0-9._-]*\/ihr-cli$/.test(name)) return name;
|
|
15
|
+
} catch (error) {
|
|
16
|
+
// The source template has no package.json next to it; keep the official default.
|
|
17
|
+
}
|
|
18
|
+
return DEFAULT_ROOT_PACKAGE_NAME;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const ROOT_PACKAGE_NAME = rootPackageName();
|
|
22
|
+
const PACKAGE_SCOPE = ROOT_PACKAGE_NAME.slice(0, ROOT_PACKAGE_NAME.indexOf("/"));
|
|
9
23
|
|
|
10
24
|
const PACKAGE_MAP = {
|
|
11
|
-
"linux-x64":
|
|
12
|
-
"linux-arm64":
|
|
13
|
-
"darwin-x64":
|
|
14
|
-
"darwin-arm64":
|
|
15
|
-
"win32-x64":
|
|
25
|
+
"linux-x64": `${PACKAGE_SCOPE}/ihr-cli-linux-x64`,
|
|
26
|
+
"linux-arm64": `${PACKAGE_SCOPE}/ihr-cli-linux-arm64`,
|
|
27
|
+
"darwin-x64": `${PACKAGE_SCOPE}/ihr-cli-darwin-x64`,
|
|
28
|
+
"darwin-arm64": `${PACKAGE_SCOPE}/ihr-cli-darwin-arm64`,
|
|
29
|
+
"win32-x64": `${PACKAGE_SCOPE}/ihr-cli-win32-x64`,
|
|
16
30
|
};
|
|
17
31
|
|
|
18
32
|
function platformKey(platform = process.platform, arch = process.arch) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ihr360cli/ihr-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45-beta.2",
|
|
4
4
|
"description": "iHR360 command-line interface",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"arm64"
|
|
25
25
|
],
|
|
26
26
|
"optionalDependencies": {
|
|
27
|
-
"@ihr360cli/ihr-cli-linux-x64": "1.0.
|
|
28
|
-
"@ihr360cli/ihr-cli-linux-arm64": "1.0.
|
|
29
|
-
"@ihr360cli/ihr-cli-darwin-x64": "1.0.
|
|
30
|
-
"@ihr360cli/ihr-cli-darwin-arm64": "1.0.
|
|
31
|
-
"@ihr360cli/ihr-cli-win32-x64": "1.0.
|
|
27
|
+
"@ihr360cli/ihr-cli-linux-x64": "1.0.45-beta.2",
|
|
28
|
+
"@ihr360cli/ihr-cli-linux-arm64": "1.0.45-beta.2",
|
|
29
|
+
"@ihr360cli/ihr-cli-darwin-x64": "1.0.45-beta.2",
|
|
30
|
+
"@ihr360cli/ihr-cli-darwin-arm64": "1.0.45-beta.2",
|
|
31
|
+
"@ihr360cli/ihr-cli-win32-x64": "1.0.45-beta.2"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|