diff --git a/bins/build.mjs b/bins/build.mjs index 32330c91147d..7593ba2d693c 100644 --- a/bins/build.mjs +++ b/bins/build.mjs @@ -13,4 +13,10 @@ config({ process.env.BUILD_OUT_ROOT = process.env.BUILD_OUT_ROOT || BUILD_OUT_ROOT; -spawn(rariBin, ["build", ...process.argv.slice(2)], { stdio: "inherit" }); +const child = spawn(rariBin, ["build", ...process.argv.slice(2)], { + stdio: "inherit", +}); + +child.on("close", (code) => { + process.exit(code); +}); diff --git a/bins/tool.mjs b/bins/tool.mjs index 54d5d8ebd9c6..7f55b6e671d5 100644 --- a/bins/tool.mjs +++ b/bins/tool.mjs @@ -14,4 +14,10 @@ config({ process.env.BUILD_OUT_ROOT = process.env.BUILD_OUT_ROOT || BUILD_OUT_ROOT; -spawn(rariBin, ["content", ...process.argv.slice(2)], { stdio: "inherit" }); +const child = spawn(rariBin, ["content", ...process.argv.slice(2)], { + stdio: "inherit", +}); + +child.on("close", (code) => { + process.exit(code); +});