@kevin0181/rcodex 0.0.2 → 0.0.3

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": "@kevin0181/rcodex",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "Gateway and provider manager for Codex: Claude, GPT, Gemini, Ollama, Antigravity, and Copilot via a single local proxy",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,40 +1,32 @@
1
- #!/usr/bin/env node
2
-
3
1
  const { execSync } = require("child_process");
4
2
  const path = require("path");
5
3
 
6
- function normalizePath(p) {
4
+ function normalizePath(inputPath) {
7
5
  try {
8
- return path.resolve(p.trim().replace(/[\\/]+/g, path.sep)).toLowerCase();
6
+ return path.resolve(inputPath.trim().replace(/[\\/]+/g, path.sep)).toLowerCase();
9
7
  } catch {
10
- return p.toLowerCase();
8
+ return inputPath.toLowerCase();
11
9
  }
12
10
  }
13
11
 
14
12
  try {
15
13
  const prefix = execSync("npm config get prefix", { encoding: "utf8" }).trim();
16
- let binDir;
17
- if (process.platform === "win32") {
18
- binDir = prefix;
19
- } else {
20
- binDir = path.join(prefix, "bin");
21
- }
22
-
14
+ const binDir = process.platform === "win32" ? prefix : path.join(prefix, "bin");
23
15
  const normalizedBinDir = normalizePath(binDir);
24
16
  const paths = (process.env.PATH || "")
25
17
  .split(path.delimiter)
26
- .map(p => normalizePath(p));
18
+ .map((entry) => normalizePath(entry));
27
19
 
28
- const isInPath = paths.some(p => p === normalizedBinDir || p === normalizedBinDir + path.sep);
20
+ const isInPath = paths.some((entry) => entry === normalizedBinDir || entry === normalizedBinDir + path.sep);
29
21
 
30
22
  if (!isInPath) {
31
23
  console.warn("\n======================================================================");
32
- console.warn("??WARNING: The global npm binaries directory is not in your PATH!");
24
+ console.warn("WARNING: The global npm binaries directory is not in your PATH.");
33
25
  console.warn("Please add the following directory to your PATH environment variable:");
34
26
  console.warn(` ${binDir}`);
35
27
  console.warn("Otherwise, the 'rcodex' command will not be recognized by your terminal.");
36
28
  console.warn("======================================================================\n");
37
29
  }
38
- } catch (e) {
39
- // Silent fail
30
+ } catch {
31
+ // Do not fail installation for a PATH warning.
40
32
  }