@kosli/cli 2.13.1-SNAPSHOT-b45c7e63 → 2.13.1-SNAPSHOT-b45c7e65

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 (3) hide show
  1. package/bin/kosli +15 -1
  2. package/install.js +12 -4
  3. package/package.json +8 -8
package/bin/kosli CHANGED
@@ -7,6 +7,20 @@ const path = require("path");
7
7
  const platform = process.platform;
8
8
  const arch = process.arch;
9
9
 
10
+ const SUPPORTED = {
11
+ linux: { x64: true, arm64: true, arm: true },
12
+ darwin: { x64: true, arm64: true },
13
+ win32: { x64: true, arm64: true },
14
+ };
15
+
16
+ if (!SUPPORTED[platform] || !SUPPORTED[platform][arch]) {
17
+ process.stderr.write(
18
+ `[kosli] Error: ${platform}/${arch} is not a supported platform.\n` +
19
+ `[kosli] See https://github.com/kosli-dev/cli for supported platforms.\n`
20
+ );
21
+ process.exit(1);
22
+ }
23
+
10
24
  const packageName = `@kosli/cli-${platform}-${arch}`;
11
25
 
12
26
  let binaryPath;
@@ -29,4 +43,4 @@ if (result.error) {
29
43
  process.stderr.write(`[kosli] Error: failed to run binary: ${result.error.message}\n`);
30
44
  process.exit(1);
31
45
  }
32
- process.exit(result.status);
46
+ process.exit(result.status ?? 1);
package/install.js CHANGED
@@ -17,7 +17,10 @@ const platform = process.platform;
17
17
  const arch = process.arch;
18
18
 
19
19
  if (!SUPPORTED[platform] || !SUPPORTED[platform][arch]) {
20
- // Not a supported platform — exit cleanly so npm install doesn't fail.
20
+ process.stderr.write(
21
+ `[kosli] Note: ${platform}/${arch} is not a supported platform.\n` +
22
+ `[kosli] The kosli binary will not be available on this system.\n`
23
+ );
21
24
  process.exit(0);
22
25
  }
23
26
 
@@ -41,14 +44,19 @@ try {
41
44
  }
42
45
 
43
46
  if (!fs.existsSync(binaryPath)) {
44
- process.stderr.write(`[kosli] Warning: binary not found at ${binaryPath}\n`);
45
- process.exit(0);
47
+ process.stderr.write(
48
+ `[kosli] Error: binary not found at ${binaryPath}\n` +
49
+ `[kosli] Try reinstalling: npm install -g @kosli/cli\n`
50
+ );
51
+ process.exit(1);
46
52
  }
47
53
 
48
54
  try {
49
55
  execFileSync(binaryPath, ["version"], { stdio: "ignore" });
50
56
  } catch (e) {
51
57
  process.stderr.write(
52
- `[kosli] Warning: binary validation failed: ${e.message}\n`
58
+ `[kosli] Error: binary validation failed: ${e.message}\n` +
59
+ `[kosli] Try reinstalling: npm install -g @kosli/cli\n`
53
60
  );
61
+ process.exit(1);
54
62
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosli/cli",
3
- "version": "2.13.1-SNAPSHOT-b45c7e63",
3
+ "version": "2.13.1-SNAPSHOT-b45c7e65",
4
4
  "description": "CLI client for reporting compliance events to https://kosli.com",
5
5
  "license": "MIT",
6
6
  "author": "Kosli Inc. <hello@kosli.com>",
@@ -30,13 +30,13 @@
30
30
  "postinstall": "node install.js"
31
31
  },
32
32
  "optionalDependencies": {
33
- "@kosli/cli-darwin-arm64": "2.13.1-SNAPSHOT-b45c7e63",
34
- "@kosli/cli-darwin-x64": "2.13.1-SNAPSHOT-b45c7e63",
35
- "@kosli/cli-linux-arm": "2.13.1-SNAPSHOT-b45c7e63",
36
- "@kosli/cli-linux-arm64": "2.13.1-SNAPSHOT-b45c7e63",
37
- "@kosli/cli-linux-x64": "2.13.1-SNAPSHOT-b45c7e63",
38
- "@kosli/cli-win32-arm64": "2.13.1-SNAPSHOT-b45c7e63",
39
- "@kosli/cli-win32-x64": "2.13.1-SNAPSHOT-b45c7e63"
33
+ "@kosli/cli-darwin-arm64": "2.13.1-SNAPSHOT-b45c7e65",
34
+ "@kosli/cli-darwin-x64": "2.13.1-SNAPSHOT-b45c7e65",
35
+ "@kosli/cli-linux-arm": "2.13.1-SNAPSHOT-b45c7e65",
36
+ "@kosli/cli-linux-arm64": "2.13.1-SNAPSHOT-b45c7e65",
37
+ "@kosli/cli-linux-x64": "2.13.1-SNAPSHOT-b45c7e65",
38
+ "@kosli/cli-win32-arm64": "2.13.1-SNAPSHOT-b45c7e65",
39
+ "@kosli/cli-win32-x64": "2.13.1-SNAPSHOT-b45c7e65"
40
40
  },
41
41
  "publishConfig": {
42
42
  "registry": "https://registry.npmjs.org",