persona-cli 1.0.0-beta.6

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/persona.cjs +32 -0
  2. package/package.json +16 -0
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ // Main-package launcher for `persona-cli`. npm installs exactly one matching
3
+ // `persona-cli-<os>-<arch>` optionalDependency (gated by os/cpu); this shim resolves
4
+ // that package's compiled binary and execs it, forwarding argv and the exit code.
5
+ 'use strict';
6
+
7
+ const { spawnSync } = require('node:child_process');
8
+
9
+ const platform = `${process.platform}-${process.arch}`; // e.g. darwin-arm64, linux-x64
10
+ const pkg = `persona-cli-${platform}`;
11
+
12
+ let binPath;
13
+ try {
14
+ binPath = require.resolve(`${pkg}/bin/persona`);
15
+ } catch {
16
+ console.error(
17
+ `persona-cli: no prebuilt binary for ${platform}.\n` +
18
+ `Supported platforms: darwin-arm64, darwin-x64, linux-x64, linux-arm64.`,
19
+ );
20
+ process.exit(1);
21
+ }
22
+
23
+ const result = spawnSync(binPath, process.argv.slice(2), { stdio: 'inherit' });
24
+ if (result.error) {
25
+ console.error(result.error.message);
26
+ process.exit(1);
27
+ }
28
+ if (result.signal) {
29
+ process.kill(process.pid, result.signal);
30
+ return;
31
+ }
32
+ process.exit(result.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "persona-cli",
3
+ "version": "1.0.0-beta.6",
4
+ "description": "Persona command-line interface",
5
+ "bin": {
6
+ "persona": "bin/persona.cjs"
7
+ },
8
+ "files": ["bin"],
9
+ "optionalDependencies": {
10
+ "persona-cli-darwin-arm64": "1.0.0-beta.6",
11
+ "persona-cli-darwin-x64": "1.0.0-beta.6",
12
+ "persona-cli-linux-x64": "1.0.0-beta.6",
13
+ "persona-cli-linux-arm64": "1.0.0-beta.6"
14
+ },
15
+ "license": "UNLICENSED"
16
+ }