hookreplay 1.0.6 → 1.0.8
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/hookreplay +29 -0
- package/package.json +1 -1
package/bin/hookreplay
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
|
|
7
|
+
const binDir = __dirname;
|
|
8
|
+
const binaryName = process.platform === 'win32' ? 'hookreplay-bin.exe' : 'hookreplay-bin';
|
|
9
|
+
const binaryPath = path.join(binDir, binaryName);
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(binaryPath)) {
|
|
12
|
+
console.error('HookReplay CLI binary not found.');
|
|
13
|
+
console.error('Try reinstalling: npm install -g hookreplay');
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
18
|
+
stdio: 'inherit',
|
|
19
|
+
shell: false
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
child.on('error', (err) => {
|
|
23
|
+
console.error('Failed to start HookReplay CLI:', err.message);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
child.on('exit', (code) => {
|
|
28
|
+
process.exit(code || 0);
|
|
29
|
+
});
|