mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
* FIxup spawn ref / unref * Fix test failures * Add test for #3480 * windows * 🪟 * Skip on linux * Fix test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
21 lines
448 B
JavaScript
21 lines
448 B
JavaScript
const { spawn } = require("node:child_process");
|
|
|
|
function exitHandler() {
|
|
console.log("exithHandler called");
|
|
}
|
|
function closeHandler() {
|
|
console.log("closeHandler called");
|
|
}
|
|
|
|
let bunExe = process.execPath;
|
|
if ((process.versions.bun || "").endsWith("_debug")) {
|
|
bunExe = "bun-debug";
|
|
} else if (bunExe.endsWith("node")) {
|
|
bunExe = "bun";
|
|
}
|
|
|
|
const p = spawn(bunExe, ["--version"]);
|
|
|
|
p.on("exit", exitHandler);
|
|
p.on("close", closeHandler);
|