@grafema/rfdb 0.2.0-beta → 0.2.1-beta
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/bin/rfdb-server.js +27 -10
- package/package.json +1 -1
package/bin/rfdb-server.js
CHANGED
|
@@ -24,19 +24,36 @@ function getBinaryPath() {
|
|
|
24
24
|
process.exit(1);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
// Check prebuilt binary first
|
|
28
|
+
const prebuiltPath = path.join(__dirname, '..', 'prebuilt', platformDir, 'rfdb-server');
|
|
29
|
+
if (fs.existsSync(prebuiltPath)) {
|
|
30
|
+
return prebuiltPath;
|
|
31
|
+
}
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
process.
|
|
33
|
+
// Fallback: check for locally built binary in common locations
|
|
34
|
+
const localPaths = [
|
|
35
|
+
// Cargo release build (when building from source)
|
|
36
|
+
path.join(__dirname, '..', 'target', 'release', 'rfdb-server'),
|
|
37
|
+
// Monorepo development
|
|
38
|
+
path.join(__dirname, '..', '..', '..', 'packages', 'rfdb-server', 'target', 'release', 'rfdb-server'),
|
|
39
|
+
// Home directory fallback for manual builds
|
|
40
|
+
path.join(process.env.HOME || '', '.local', 'bin', 'rfdb-server'),
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
for (const localPath of localPaths) {
|
|
44
|
+
if (fs.existsSync(localPath)) {
|
|
45
|
+
return localPath;
|
|
46
|
+
}
|
|
37
47
|
}
|
|
38
48
|
|
|
39
|
-
|
|
49
|
+
console.error(`Binary not found for ${platform}-${arch}`);
|
|
50
|
+
console.error(`Expected at: ${prebuiltPath}`);
|
|
51
|
+
console.error('');
|
|
52
|
+
console.error('Available options:');
|
|
53
|
+
console.error('1. Build from source: cargo build --release');
|
|
54
|
+
console.error('2. Copy binary to: ~/.local/bin/rfdb-server');
|
|
55
|
+
console.error('3. Download from GitHub releases');
|
|
56
|
+
process.exit(1);
|
|
40
57
|
}
|
|
41
58
|
|
|
42
59
|
const binaryPath = getBinaryPath();
|