rapay 1.0.0 → 1.0.2
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/ra +32 -4
- package/install.js +5 -4
- package/package.json +1 -1
package/bin/ra
CHANGED
|
@@ -1,4 +1,32 @@
|
|
|
1
|
-
#!/bin/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const os = require('os');
|
|
6
|
+
|
|
7
|
+
const binDir = __dirname;
|
|
8
|
+
const platform = os.platform();
|
|
9
|
+
const binaryName = platform === 'win32' ? 'ra.exe' : 'ra-binary';
|
|
10
|
+
const binaryPath = path.join(binDir, binaryName);
|
|
11
|
+
|
|
12
|
+
// Check if binary exists
|
|
13
|
+
const fs = require('fs');
|
|
14
|
+
if (!fs.existsSync(binaryPath)) {
|
|
15
|
+
console.error('Ra Pay CLI not installed properly. Please reinstall with: npm install -g rapay');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Spawn the binary with all arguments
|
|
20
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
21
|
+
stdio: 'inherit',
|
|
22
|
+
windowsHide: true
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
child.on('error', (err) => {
|
|
26
|
+
console.error('Failed to start Ra Pay CLI:', err.message);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
child.on('close', (code) => {
|
|
31
|
+
process.exit(code || 0);
|
|
32
|
+
});
|
package/install.js
CHANGED
|
@@ -12,8 +12,8 @@ const path = require('path');
|
|
|
12
12
|
const https = require('https');
|
|
13
13
|
const os = require('os');
|
|
14
14
|
|
|
15
|
-
const VERSION = '1.0.
|
|
16
|
-
const
|
|
15
|
+
const VERSION = '1.0.1'; // CDN binary version (npm package version may differ)
|
|
16
|
+
const CDN_BASE = 'https://cdn.rapay.ai';
|
|
17
17
|
|
|
18
18
|
// Platform/arch to binary name mapping
|
|
19
19
|
// NOTE: linux-arm64 not supported yet (keyring native libs don't cross-compile)
|
|
@@ -48,7 +48,7 @@ function getBinaryName() {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
function getDownloadUrl(filename) {
|
|
51
|
-
return
|
|
51
|
+
return `${CDN_BASE}/v${VERSION}/${filename}`;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function download(url) {
|
|
@@ -105,7 +105,8 @@ async function install() {
|
|
|
105
105
|
const binDir = path.join(__dirname, 'bin');
|
|
106
106
|
const platform = os.platform();
|
|
107
107
|
const binaryName = getBinaryName();
|
|
108
|
-
|
|
108
|
+
// Windows: ra.exe, Unix: ra-binary (launcher script handles dispatch)
|
|
109
|
+
const destName = platform === 'win32' ? 'ra.exe' : 'ra-binary';
|
|
109
110
|
const destPath = path.join(binDir, destName);
|
|
110
111
|
const binaryUrl = getDownloadUrl(binaryName);
|
|
111
112
|
const checksumsUrl = getDownloadUrl('checksums.txt');
|