swytchcode 2.2.3 → 2.2.5

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/swytchcode.js +15 -0
  2. package/package.json +7 -7
package/bin/swytchcode.js CHANGED
@@ -71,6 +71,14 @@ try {
71
71
  process.exit(1);
72
72
  }
73
73
 
74
+ // Detect npx: npm 7+ runs `npx` as `npm exec` (npm_command=exec),
75
+ // older npm puts the binary in a _npx temp dir, and even older npm names npx in npm_execpath.
76
+ const isNpx =
77
+ (process.env.npm_command || '') === 'exec' ||
78
+ __filename.includes('_npx') ||
79
+ binPath.includes('_npx') ||
80
+ (process.env.npm_execpath || '').includes('npx');
81
+
74
82
  const result = spawnBin(binPath, process.argv.slice(2));
75
83
 
76
84
  if (result.error) {
@@ -78,4 +86,11 @@ if (result.error) {
78
86
  process.exit(1);
79
87
  }
80
88
 
89
+ if (isNpx && result.status === 0) {
90
+ process.stderr.write(
91
+ '\n\x1b[33mTip:\x1b[0m install swytchcode globally for faster startup:\n' +
92
+ ' npm install -g swytchcode\n\n'
93
+ );
94
+ }
95
+
81
96
  process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "swytchcode",
3
- "version": "2.2.3",
3
+ "version": "2.2.5",
4
4
  "description": "Execution layer for API integrations",
5
5
  "keywords": [
6
6
  "api",
@@ -23,11 +23,11 @@
23
23
  "README.md"
24
24
  ],
25
25
  "optionalDependencies": {
26
- "swytchcode-cli-darwin-arm64": "2.2.3",
27
- "swytchcode-cli-darwin-x64": "2.2.3",
28
- "swytchcode-cli-linux-arm64": "2.2.3",
29
- "swytchcode-cli-linux-x64": "2.2.3",
30
- "swytchcode-cli-win32-arm64": "2.2.3",
31
- "swytchcode-cli-win32-x64": "2.2.3"
26
+ "swytchcode-cli-darwin-arm64": "2.2.5",
27
+ "swytchcode-cli-darwin-x64": "2.2.5",
28
+ "swytchcode-cli-linux-arm64": "2.2.5",
29
+ "swytchcode-cli-linux-x64": "2.2.5",
30
+ "swytchcode-cli-win32-arm64": "2.2.5",
31
+ "swytchcode-cli-win32-x64": "2.2.5"
32
32
  }
33
33
  }