@aipoju/breakout-cli 0.1.1 → 0.1.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.
Files changed (2) hide show
  1. package/bin/breakout.js +20 -0
  2. package/package.json +7 -7
package/bin/breakout.js CHANGED
@@ -3,6 +3,7 @@
3
3
  "use strict";
4
4
 
5
5
  const { spawn } = require("node:child_process");
6
+ const { accessSync, chmodSync, constants } = require("node:fs");
6
7
  const { dirname, join } = require("node:path");
7
8
 
8
9
  const platform = process.platform;
@@ -33,6 +34,25 @@ try {
33
34
  process.exit(1);
34
35
  }
35
36
 
37
+ if (platform !== "win32") {
38
+ try {
39
+ accessSync(executablePath, constants.X_OK);
40
+ } catch {
41
+ try {
42
+ chmodSync(executablePath, 0o755);
43
+ } catch (error) {
44
+ console.error(
45
+ "破局官网 CLI 原生程序缺少执行权限,请重新安装:" +
46
+ "npm install -g @aipoju/breakout-cli@latest",
47
+ );
48
+ if (process.env.BREAKOUT_CLI_DEBUG === "1") {
49
+ console.error(error);
50
+ }
51
+ process.exit(1);
52
+ }
53
+ }
54
+ }
55
+
36
56
  const child = spawn(executablePath, process.argv.slice(2), {
37
57
  stdio: "inherit",
38
58
  windowsHide: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aipoju/breakout-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "AI 破局俱乐部官方命令行工具",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -17,12 +17,12 @@
17
17
  "access": "public"
18
18
  },
19
19
  "optionalDependencies": {
20
- "@aipoju/breakout-cli-darwin-arm64": "0.1.1",
21
- "@aipoju/breakout-cli-darwin-x64": "0.1.1",
22
- "@aipoju/breakout-cli-linux-arm64": "0.1.1",
23
- "@aipoju/breakout-cli-linux-x64": "0.1.1",
24
- "@aipoju/breakout-cli-win32-arm64": "0.1.1",
25
- "@aipoju/breakout-cli-win32-x64": "0.1.1"
20
+ "@aipoju/breakout-cli-darwin-arm64": "0.1.2",
21
+ "@aipoju/breakout-cli-darwin-x64": "0.1.2",
22
+ "@aipoju/breakout-cli-linux-arm64": "0.1.2",
23
+ "@aipoju/breakout-cli-linux-x64": "0.1.2",
24
+ "@aipoju/breakout-cli-win32-arm64": "0.1.2",
25
+ "@aipoju/breakout-cli-win32-x64": "0.1.2"
26
26
  },
27
27
  "scripts": {
28
28
  "build:packages": "node scripts/build-packages.mjs",