From e342216346a4e86404f92b878c829785c766f4cb Mon Sep 17 00:00:00 2001 From: Pokey Rule <755842+pokey@users.noreply.github.com> Date: Fri, 10 Nov 2023 17:29:35 +0000 Subject: [PATCH] inherit exit code --- packages/common/scripts/my-ts-node.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/common/scripts/my-ts-node.js b/packages/common/scripts/my-ts-node.js index f32f732869..e8155a2680 100755 --- a/packages/common/scripts/my-ts-node.js +++ b/packages/common/scripts/my-ts-node.js @@ -79,7 +79,8 @@ function main() { esbuildProcess.on("close", (code) => { if (code === 0) { // Execute the bundled file with Node, passing any additional arguments - runCommand(process.execPath, [outFile, ...childArgs]); + const nodeProcess = runCommand(process.execPath, [outFile, ...childArgs]); + nodeProcess.on("close", (code) => process.exit(code ?? undefined)); } else { console.error(`esbuild failed with code ${code}`); process.exit(code ?? undefined);