@typerighter/rpc-server 0.3.0 → 0.4.0
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/index.js +5 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -4,7 +4,11 @@ import { EventEmitter } from "node:events";
|
|
|
4
4
|
import { binPath } from "./platform.js";
|
|
5
5
|
|
|
6
6
|
function resolveBin() {
|
|
7
|
-
// Prefer
|
|
7
|
+
// Prefer local binary (dev build or downloaded release)
|
|
8
|
+
const local = binPath();
|
|
9
|
+
if (existsSync(local)) return local;
|
|
10
|
+
|
|
11
|
+
// Fall back to system binary
|
|
8
12
|
try {
|
|
9
13
|
const system = execFileSync("which", ["typedown-rpc"], { encoding: "utf-8" }).trim();
|
|
10
14
|
if (system) return system;
|
|
@@ -12,10 +16,6 @@ function resolveBin() {
|
|
|
12
16
|
// ignore
|
|
13
17
|
}
|
|
14
18
|
|
|
15
|
-
// Fall back to downloaded binary
|
|
16
|
-
const local = binPath();
|
|
17
|
-
if (existsSync(local)) return local;
|
|
18
|
-
|
|
19
19
|
throw new Error(
|
|
20
20
|
`typedown-rpc binary not found. Run "pnpm install" to download it, ` +
|
|
21
21
|
`install via Nix, or build manually with "cargo build --release -p typedown-server".`,
|