rhx 0.2.1 → 0.2.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.
Files changed (2) hide show
  1. package/bin/rhx-lib.cjs +19 -12
  2. package/package.json +4 -4
package/bin/rhx-lib.cjs CHANGED
@@ -25,7 +25,8 @@ function resolveNativeBinary({
25
25
  platform = process.platform,
26
26
  arch = process.arch,
27
27
  requireResolve = require.resolve,
28
- exists = fs.existsSync
28
+ exists = fs.existsSync,
29
+ baseDir = __dirname
29
30
  } = {}) {
30
31
  const key = targetKey(platform, arch);
31
32
  const spec = NATIVE_TARGETS[key];
@@ -39,18 +40,24 @@ function resolveNativeBinary({
39
40
  };
40
41
  }
41
42
 
42
- try {
43
- const packageJsonPath = requireResolve(`${spec.packageName}/package.json`);
44
- const binaryPath = path.join(path.dirname(packageJsonPath), spec.binaryRelPath);
43
+ const localNodeModulesBinary = path.resolve(
44
+ baseDir,
45
+ "..",
46
+ "node_modules",
47
+ spec.packageName,
48
+ spec.binaryRelPath
49
+ );
50
+ if (exists(localNodeModulesBinary)) {
51
+ return {
52
+ supported: true,
53
+ key,
54
+ packageName: spec.packageName,
55
+ binaryPath: localNodeModulesBinary
56
+ };
57
+ }
45
58
 
46
- if (!exists(binaryPath)) {
47
- return {
48
- supported: true,
49
- key,
50
- packageName: spec.packageName,
51
- binaryPath: null
52
- };
53
- }
59
+ try {
60
+ const binaryPath = requireResolve(`${spec.packageName}/${spec.binaryRelPath}`);
54
61
 
55
62
  return {
56
63
  supported: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rhx",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Native npx launcher for the rhx CLI",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -30,9 +30,9 @@
30
30
  "trading"
31
31
  ],
32
32
  "optionalDependencies": {
33
- "rhx-darwin-arm64": "0.2.1",
34
- "rhx-linux-x64": "0.2.1",
35
- "rhx-win32-x64": "0.2.1"
33
+ "rhx-darwin-arm64": "0.2.3",
34
+ "rhx-linux-x64": "0.2.3",
35
+ "rhx-win32-x64": "0.2.3"
36
36
  },
37
37
  "scripts": {
38
38
  "sync:versions": "node scripts/sync-platform-versions.cjs",