@afix-ci/cli 0.1.0-rc.47 → 0.1.0-rc.48
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/install.js +30 -0
- package/package.json +10 -6
- package/shim.js +1 -3
package/install.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Auto-generated by bundle-npm. Do not edit.
|
|
2
|
+
|
|
3
|
+
import { createRequire } from "module";
|
|
4
|
+
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
|
|
7
|
+
const platforms = {
|
|
8
|
+
"darwin-arm64": { pkg: "@afix-ci/cli-darwin-arm64", bin: "cli" },
|
|
9
|
+
"linux-x64": { pkg: "@afix-ci/cli-linux-x64", bin: "cli" },
|
|
10
|
+
"linux-arm64": { pkg: "@afix-ci/cli-linux-arm64", bin: "cli" },
|
|
11
|
+
"win32-x64": { pkg: "@afix-ci/cli-win32-x64", bin: "cli.exe" },
|
|
12
|
+
"win32-arm64": { pkg: "@afix-ci/cli-win32-arm64", bin: "cli.exe" },
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const key = `${process.platform}-${process.arch}`;
|
|
16
|
+
const entry = platforms[key];
|
|
17
|
+
if (!entry) {
|
|
18
|
+
throw new Error(`Unsupported platform: ${key}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
require.resolve(`${entry.pkg}/${entry.bin}`);
|
|
23
|
+
} catch (cause) {
|
|
24
|
+
throw new Error(
|
|
25
|
+
`Failed to find the platform-specific package "${entry.pkg}". ` +
|
|
26
|
+
`This package is installed through optionalDependencies; reinstall without ` +
|
|
27
|
+
`"--no-optional" or "--omit=optional".`,
|
|
28
|
+
{ cause },
|
|
29
|
+
);
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@afix-ci/cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0-rc.
|
|
4
|
+
"version": "0.1.0-rc.48",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"files": [
|
|
8
|
+
"install.js",
|
|
8
9
|
"shim.js"
|
|
9
10
|
],
|
|
10
11
|
"bin": {
|
|
11
12
|
"afix": "./shim.js"
|
|
12
13
|
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"postinstall": "node install.js"
|
|
16
|
+
},
|
|
13
17
|
"optionalDependencies": {
|
|
14
|
-
"@afix-ci/cli-darwin-arm64": "0.1.0-rc.
|
|
15
|
-
"@afix-ci/cli-linux-arm64": "0.1.0-rc.
|
|
16
|
-
"@afix-ci/cli-linux-x64": "0.1.0-rc.
|
|
17
|
-
"@afix-ci/cli-win32-arm64": "0.1.0-rc.
|
|
18
|
-
"@afix-ci/cli-win32-x64": "0.1.0-rc.
|
|
18
|
+
"@afix-ci/cli-darwin-arm64": "0.1.0-rc.48",
|
|
19
|
+
"@afix-ci/cli-linux-arm64": "0.1.0-rc.48",
|
|
20
|
+
"@afix-ci/cli-linux-x64": "0.1.0-rc.48",
|
|
21
|
+
"@afix-ci/cli-win32-arm64": "0.1.0-rc.48",
|
|
22
|
+
"@afix-ci/cli-win32-x64": "0.1.0-rc.48"
|
|
19
23
|
}
|
|
20
24
|
}
|
package/shim.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
import { createRequire } from "module";
|
|
5
5
|
import { spawnSync } from "child_process";
|
|
6
|
-
import { fileURLToPath } from "url";
|
|
7
6
|
|
|
8
7
|
const require = createRequire(import.meta.url);
|
|
9
8
|
|
|
@@ -22,8 +21,7 @@ if (!entry) {
|
|
|
22
21
|
process.exit(1);
|
|
23
22
|
}
|
|
24
23
|
|
|
25
|
-
const
|
|
26
|
-
const binPath = new URL(`../${entry.bin}`, "file://" + pkgDir).pathname;
|
|
24
|
+
const binPath = require.resolve(`${entry.pkg}/${entry.bin}`);
|
|
27
25
|
|
|
28
26
|
const result = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
29
27
|
process.exit(result.status ?? 1);
|