@jonaskahn/relo 0.1.14-beta.50.42407133 → 0.1.14-beta.52.4a559ce0
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/lib/conflict.mjs +20 -2
- package/lib/progress.mjs +1 -1
- package/package.json +1 -1
package/lib/conflict.mjs
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// installers. Two installs would still fight over the name, the home
|
|
4
4
|
// directory, and the ports, so the install refuses when a command this
|
|
5
5
|
// package did not install answers PATH.
|
|
6
|
-
import { accessSync, constants, existsSync, realpathSync } from 'node:fs';
|
|
7
|
-
import { delimiter, join, resolve, sep } from 'node:path';
|
|
6
|
+
import { accessSync, constants, existsSync, readFileSync, realpathSync } from 'node:fs';
|
|
7
|
+
import { delimiter, dirname, join, resolve, sep } from 'node:path';
|
|
8
8
|
import { homedir } from 'node:os';
|
|
9
9
|
import { execFileSync } from 'node:child_process';
|
|
10
10
|
|
|
@@ -44,11 +44,29 @@ export function findConflictingRelo({
|
|
|
44
44
|
if (selfDir && insideDir(candidate, selfDir)) {
|
|
45
45
|
continue;
|
|
46
46
|
}
|
|
47
|
+
if (selfDir && nodePlatform === 'win32' && ownNpmShim(candidate, selfDir)) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
47
50
|
return candidate;
|
|
48
51
|
}
|
|
49
52
|
return null;
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
// npm's Windows command shim is a batch file, not a symlink. Recognize its
|
|
56
|
+
// launcher invocation only; other shim formats remain conflicts until supported.
|
|
57
|
+
function ownNpmShim(candidate, selfDir) {
|
|
58
|
+
if (!candidate.toLowerCase().endsWith('.cmd')) return false;
|
|
59
|
+
try {
|
|
60
|
+
const text = readFileSync(candidate, 'utf8');
|
|
61
|
+
const match = /"%_prog%"[ \t]+"%dp0%\\([^"\r\n]+)"[ \t]+%\*/i.exec(text);
|
|
62
|
+
if (!match) return false;
|
|
63
|
+
const launcher = resolve(dirname(candidate), ...match[1].split('\\'));
|
|
64
|
+
return realpathSync(launcher) === realpathSync(join(selfDir, 'relo.mjs'));
|
|
65
|
+
} catch {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
52
70
|
// appBundles lists where the macOS Relo.app may live. The bundle installs
|
|
53
71
|
// no command on PATH, so the PATH search below never sees it, and a stacked
|
|
54
72
|
// install would fight it over the home directory and the ports.
|
package/lib/progress.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jonaskahn/relo",
|
|
3
|
-
"version": "0.1.14-beta.
|
|
3
|
+
"version": "0.1.14-beta.52.4a559ce0",
|
|
4
4
|
"description": "One local proxy that lets Codex, Claude Code, Cursor and Grok, etc. Talk to any model, any provider with no config changes",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"type": "module",
|