@reoclo/cli 0.9.0

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.
Files changed (2) hide show
  1. package/bin.js +23 -0
  2. package/package.json +15 -0
package/bin.js ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+ // packaging/npm-shim/bin.js
3
+ const { spawnSync } = require("node:child_process");
4
+ const archMap = { x64: "x64", arm64: "arm64" };
5
+ const osMap = { darwin: "darwin", linux: "linux", win32: "windows" };
6
+ const ext = process.platform === "win32" ? ".exe" : "";
7
+ const arch = archMap[process.arch];
8
+ const plat = osMap[process.platform];
9
+ if (!arch || !plat) {
10
+ console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
11
+ process.exit(1);
12
+ }
13
+ const pkg = `@reoclo/cli-${plat}-${arch}`;
14
+ let bin;
15
+ try {
16
+ bin = require.resolve(`${pkg}/reoclo${ext}`);
17
+ } catch {
18
+ console.error(`Error: ${pkg} is not installed for this platform.`);
19
+ console.error("Install via: brew install reoclo/tap/reoclo OR curl -sSL https://get.reoclo.com/cli | bash");
20
+ process.exit(1);
21
+ }
22
+ const r = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
23
+ process.exit(r.status ?? 0);
package/package.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "@reoclo/cli",
3
+ "version": "0.9.0",
4
+ "description": "Reoclo CLI",
5
+ "license": "MIT",
6
+ "bin": { "reoclo": "./bin.js" },
7
+ "engines": { "node": ">=18" },
8
+ "optionalDependencies": {
9
+ "@reoclo/cli-linux-x64": "0.9.0",
10
+ "@reoclo/cli-linux-arm64": "0.9.0",
11
+ "@reoclo/cli-darwin-x64": "0.9.0",
12
+ "@reoclo/cli-darwin-arm64": "0.9.0",
13
+ "@reoclo/cli-windows-x64": "0.9.0"
14
+ }
15
+ }