verus-pm 0.2.16 → 0.3.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/bin/verus-darwin-amd64 +0 -0
- package/bin/verus-darwin-arm64 +0 -0
- package/bin/verus-linux-amd64 +0 -0
- package/bin/verus-linux-arm64 +0 -0
- package/bin/verus-windows-amd64.exe +0 -0
- package/bin/verus.js +26 -7
- package/package.json +1 -1
package/bin/verus-darwin-amd64
CHANGED
|
Binary file
|
package/bin/verus-darwin-arm64
CHANGED
|
Binary file
|
package/bin/verus-linux-amd64
CHANGED
|
Binary file
|
package/bin/verus-linux-arm64
CHANGED
|
Binary file
|
|
Binary file
|
package/bin/verus.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { existsSync } = require("node:fs");
|
|
4
|
-
const {
|
|
4
|
+
const { spawn } = require("node:child_process");
|
|
5
5
|
const { join } = require("node:path");
|
|
6
6
|
|
|
7
7
|
const PLATFORM_NAMES = { darwin: "darwin", linux: "linux", win32: "windows" };
|
|
@@ -27,11 +27,30 @@ if (!binaryPath) {
|
|
|
27
27
|
process.exit(1);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
// Use async spawn to properly forward signals and keep the child process
|
|
31
|
+
// attached to this session. spawnSync doesn't forward signals correctly,
|
|
32
|
+
// causing the child to become orphaned when the terminal closes.
|
|
33
|
+
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
34
|
+
stdio: "inherit",
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// Forward signals to child process so Ctrl+C and terminal close work correctly
|
|
38
|
+
for (const sig of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
39
|
+
process.on(sig, () => {
|
|
40
|
+
child.kill(sig);
|
|
41
|
+
});
|
|
35
42
|
}
|
|
36
43
|
|
|
37
|
-
|
|
44
|
+
child.on("error", (err) => {
|
|
45
|
+
console.error(`Failed to launch Verus: ${err.message}`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
child.on("exit", (code, signal) => {
|
|
50
|
+
if (signal) {
|
|
51
|
+
// Re-raise the signal so the parent shell sees the correct exit reason
|
|
52
|
+
process.kill(process.pid, signal);
|
|
53
|
+
} else {
|
|
54
|
+
process.exit(code ?? 1);
|
|
55
|
+
}
|
|
56
|
+
});
|