@kud/revu-cli 1.0.12 → 1.0.13

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/revu.js +12 -4
  2. package/package.json +4 -4
package/bin/revu.js CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from "module"
3
3
  import { spawnSync } from "child_process"
4
+ import { fileURLToPath } from "url"
5
+ import { join, dirname } from "path"
6
+ import { existsSync } from "fs"
4
7
 
5
8
  const require = createRequire(import.meta.url)
6
9
 
@@ -29,10 +32,15 @@ let binaryPath
29
32
  try {
30
33
  binaryPath = require.resolve(`${pkg}/revu-bin`)
31
34
  } catch {
32
- console.error(
33
- `revu-cli: could not find binary for ${platform}. Try reinstalling revu-cli.`,
34
- )
35
- process.exit(1)
35
+ const localBin = join(dirname(fileURLToPath(import.meta.url)), "../revu-bin")
36
+ if (existsSync(localBin)) {
37
+ binaryPath = localBin
38
+ } else {
39
+ console.error(
40
+ `revu-cli: could not find binary for ${platform}. Try reinstalling revu-cli.`,
41
+ )
42
+ process.exit(1)
43
+ }
36
44
  }
37
45
 
38
46
  const result = spawnSync(binaryPath, process.argv.slice(2), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/revu-cli",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Interactive terminal diff reviewer",
5
5
  "module": "index.ts",
6
6
  "type": "module",
@@ -23,9 +23,9 @@
23
23
  "bump:major": "bun scripts/bump.ts major"
24
24
  },
25
25
  "optionalDependencies": {
26
- "@kud/revu-cli-darwin-arm64": "1.0.12",
27
- "@kud/revu-cli-linux-x64": "1.0.12",
28
- "@kud/revu-cli-linux-arm64": "1.0.12"
26
+ "@kud/revu-cli-darwin-arm64": "1.0.13",
27
+ "@kud/revu-cli-linux-x64": "1.0.13",
28
+ "@kud/revu-cli-linux-arm64": "1.0.13"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/bun": "latest"