@qoder-ai/qodercli 1.1.92 → 1.1.94

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qoder-ai/qodercli",
3
- "version": "1.1.92",
3
+ "version": "1.1.94",
4
4
  "description": "Qoder AI CLI - AI-powered coding assistant",
5
5
  "author": "Qoder AI",
6
6
  "type": "module",
@@ -20,12 +20,12 @@
20
20
  "sharp": "^0.34.5"
21
21
  },
22
22
  "optionalDependencies": {
23
- "@qoder-ai/qodercli-ripgrep-darwin-arm64": "1.1.92",
24
- "@qoder-ai/qodercli-ripgrep-darwin-x64": "1.1.92",
25
- "@qoder-ai/qodercli-ripgrep-linux-arm64": "1.1.92",
26
- "@qoder-ai/qodercli-ripgrep-linux-x64": "1.1.92",
27
- "@qoder-ai/qodercli-ripgrep-win32-arm64": "1.1.92",
28
- "@qoder-ai/qodercli-ripgrep-win32-x64": "1.1.92"
23
+ "@qoder-ai/qodercli-ripgrep-darwin-arm64": "1.1.94",
24
+ "@qoder-ai/qodercli-ripgrep-darwin-x64": "1.1.94",
25
+ "@qoder-ai/qodercli-ripgrep-linux-arm64": "1.1.94",
26
+ "@qoder-ai/qodercli-ripgrep-linux-x64": "1.1.94",
27
+ "@qoder-ai/qodercli-ripgrep-win32-arm64": "1.1.94",
28
+ "@qoder-ai/qodercli-ripgrep-win32-x64": "1.1.94"
29
29
  },
30
30
  "engines": {
31
31
  "node": ">=20.0.0"
package/postinstall.cjs CHANGED
@@ -100,15 +100,27 @@ try {
100
100
  warnIfRipgrepUnavailable();
101
101
  } catch {
102
102
  }
103
- if (process.platform === "win32") {
103
+ if (isGlobalNpmInstall()) {
104
+ if (process.platform === "win32") {
105
+ try {
106
+ ensureNpmBinOnPath();
107
+ } catch {
108
+ }
109
+ }
104
110
  try {
105
- ensureNpmBinOnPath();
111
+ configurePathBestEffort();
106
112
  } catch {
107
113
  }
108
114
  }
109
- try {
110
- configurePathBestEffort();
111
- } catch {
115
+ function isGlobalNpmInstall() {
116
+ const global = readNpmConfig("global")?.toLowerCase();
117
+ return global === "true" || global === "1" || readNpmConfig("location") === "global";
118
+ }
119
+ function readNpmConfig(name) {
120
+ const key = `npm_config_${name}`;
121
+ return process.env[key] ?? Object.entries(process.env).find(
122
+ ([candidate]) => candidate.toLowerCase() === key
123
+ )?.[1];
112
124
  }
113
125
  function configurePathBestEffort() {
114
126
  const fs = require("node:fs");