gtx-cli 2.5.30-alpha.2 → 2.5.30-alpha.4

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/dist/router.js +15 -1
  2. package/package.json +1 -1
package/dist/router.js CHANGED
@@ -3,7 +3,7 @@
3
3
  import { spawn } from 'child_process';
4
4
  import { fileURLToPath } from 'url';
5
5
  import { dirname, join } from 'path';
6
- import { existsSync } from 'fs';
6
+ import { existsSync, chmodSync, statSync } from 'fs';
7
7
  const __filename = fileURLToPath(import.meta.url);
8
8
  const __dirname = dirname(__filename);
9
9
  function detectPlatform() {
@@ -34,6 +34,20 @@ function routeToBinary() {
34
34
  if (!existsSync(binaryPath)) {
35
35
  return;
36
36
  }
37
+ // Check and fix execute permissions if needed (Unix-like systems only)
38
+ if (process.platform !== 'win32') {
39
+ try {
40
+ const stats = statSync(binaryPath);
41
+ const isExecutable = !!(stats.mode & parseInt('100', 8)); // Check owner execute bit
42
+ if (!isExecutable) {
43
+ chmodSync(binaryPath, 0o755); // Make executable
44
+ }
45
+ }
46
+ catch (error) {
47
+ // If we can't check/fix permissions, continue anyway
48
+ // The spawn might still work or give a more meaningful error
49
+ }
50
+ }
37
51
  // Spawn the appropriate binary with all arguments
38
52
  const child = spawn(binaryPath, process.argv.slice(2), {
39
53
  stdio: 'inherit',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtx-cli",
3
- "version": "2.5.30-alpha.2",
3
+ "version": "2.5.30-alpha.4",
4
4
  "main": "dist/index.js",
5
5
  "bin": "dist/router.js",
6
6
  "files": [