gitnexus 1.6.4-rc.50 → 1.6.4-rc.51

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/cli/setup.js +16 -6
  2. package/package.json +1 -1
package/dist/cli/setup.js CHANGED
@@ -23,15 +23,25 @@ const execFileAsync = promisify(execFile);
23
23
  */
24
24
  function resolveGitnexusBin() {
25
25
  try {
26
- const cmd = process.platform === 'win32' ? 'where' : 'which';
27
- const resolved = execFileSync(cmd, ['gitnexus'], {
26
+ const isWin = process.platform === 'win32';
27
+ const cmd = isWin ? 'where' : 'which';
28
+ const output = execFileSync(cmd, ['gitnexus'], {
28
29
  encoding: 'utf-8',
29
30
  timeout: 5000,
30
31
  stdio: ['ignore', 'pipe', 'ignore'],
31
- })
32
- .split('\n')[0]
33
- .trim();
34
- return resolved || null;
32
+ });
33
+ const lines = output
34
+ .split('\n')
35
+ .map((l) => l.trim())
36
+ .filter(Boolean);
37
+ if (isWin) {
38
+ // On Windows, `where` returns multiple entries (e.g. the POSIX shell
39
+ // script AND the .cmd/.bat wrapper). Prefer the wrapper because
40
+ // child_process.spawn() cannot execute a shell script directly.
41
+ const cmdLine = lines.find((l) => /\.(cmd|bat)$/i.test(l));
42
+ return cmdLine || lines[0] || null;
43
+ }
44
+ return lines[0] || null;
35
45
  }
36
46
  catch {
37
47
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.4-rc.50",
3
+ "version": "1.6.4-rc.51",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",