@jonaskahn/relo 0.1.14-beta.52.4a559ce0 → 0.1.14-beta.54.6d5172a4
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 +14 -15
- 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,
|
|
7
|
-
import { delimiter, dirname, join, resolve, sep } from 'node:path';
|
|
6
|
+
import { accessSync, constants, existsSync, realpathSync } from 'node:fs';
|
|
7
|
+
import { basename, 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,7 +44,7 @@ export function findConflictingRelo({
|
|
|
44
44
|
if (selfDir && insideDir(candidate, selfDir)) {
|
|
45
45
|
continue;
|
|
46
46
|
}
|
|
47
|
-
if (selfDir && nodePlatform === 'win32' &&
|
|
47
|
+
if (selfDir && nodePlatform === 'win32' && inGlobalBin(candidate, selfDir)) {
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
50
50
|
return candidate;
|
|
@@ -52,19 +52,18 @@ export function findConflictingRelo({
|
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
} catch {
|
|
66
|
-
return false;
|
|
55
|
+
// On Windows npm keeps its command shims in the prefix that holds node_modules,
|
|
56
|
+
// and a version manager may expose that prefix through a link or add shims of
|
|
57
|
+
// its own. npm already refuses to overwrite another package's command there,
|
|
58
|
+
// so whatever sits in this install's global bin is not a second Relo.
|
|
59
|
+
function inGlobalBin(candidate, selfDir) {
|
|
60
|
+
let modules = selfDir;
|
|
61
|
+
while (basename(modules) !== 'node_modules') {
|
|
62
|
+
const parent = dirname(modules);
|
|
63
|
+
if (parent === modules) return false;
|
|
64
|
+
modules = parent;
|
|
67
65
|
}
|
|
66
|
+
return existingPath(dirname(candidate)) === existingPath(dirname(modules));
|
|
68
67
|
}
|
|
69
68
|
|
|
70
69
|
// appBundles lists where the macOS Relo.app may live. The bundle installs
|
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.54.6d5172a4",
|
|
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",
|