reredd-cli 2.0.1 → 2.1.12

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/reredd.js +14 -2
  2. package/package.json +6 -6
package/bin/reredd.js CHANGED
@@ -23,10 +23,22 @@ let binPath;
23
23
  try {
24
24
  const isWindows = process.platform === "win32";
25
25
  const binaryName = isWindows ? "reredd.exe" : "reredd";
26
- binPath = require.resolve(`${pkgName}/${binaryName}`);
26
+
27
+ try {
28
+ // 1. Try standard installation path (node_modules)
29
+ binPath = require.resolve(`${pkgName}/${binaryName}`);
30
+ } catch {
31
+ // 2. Fallback for local development: check sibling directories in packages/
32
+ binPath = join(__dirname, "..", "..", pkgName, binaryName);
33
+ const fs = require("fs");
34
+ if (!fs.existsSync(binPath)) {
35
+ throw new Error("Binary not found");
36
+ }
37
+ }
27
38
  } catch {
28
39
  console.error(
29
- `reredd: could not find binary for ${key}. ` +
40
+ `reredd: could not find binary for ${key}. \n` +
41
+ `Tried looking in node_modules and sibling packages.\n` +
30
42
  `Try reinstalling: npm install -g reredd`
31
43
  );
32
44
  process.exit(1);
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "reredd-cli",
3
- "version": "2.0.1",
3
+ "version": "2.1.12",
4
4
  "description": "Premium Reddit automation CLI — Pre-compiled binaries.",
5
5
  "bin": {
6
- "reredd": "./bin/reredd.js"
6
+ "reredd": "bin/reredd.js"
7
7
  },
8
8
  "files": [
9
9
  "bin/"
10
10
  ],
11
11
  "optionalDependencies": {
12
- "reredd-darwin-arm64": "2.0.0",
13
- "reredd-darwin-x64": "2.0.0",
14
- "reredd-linux-x64": "2.0.0",
15
- "reredd-windows-x64": "2.0.0"
12
+ "reredd-darwin-arm64": "2.1.12",
13
+ "reredd-darwin-x64": "2.1.12",
14
+ "reredd-linux-x64": "2.1.12",
15
+ "reredd-windows-x64": "2.1.12"
16
16
  }
17
17
  }