From e1ef69d99e7b1e3e04f29df309569e893bdd2dff Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 3 Nov 2023 11:18:21 -0400 Subject: [PATCH] pass 'detached:true' for diff tool (#56293) --- scripts/build/utils.mjs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/build/utils.mjs b/scripts/build/utils.mjs index a0d319f6397..35f8ca63568 100644 --- a/scripts/build/utils.mjs +++ b/scripts/build/utils.mjs @@ -28,7 +28,7 @@ export async function exec(cmd, args, options = {}) { const { ignoreExitCode, waitForExit = true, ignoreStdout } = options; if (!options.hidePrompt) console.log(`> ${chalk.green(cmd)} ${args.join(" ")}`); - const proc = spawn(which.sync(cmd), args, { stdio: waitForExit ? ignoreStdout ? ["inherit", "ignore", "inherit"] : "inherit" : "ignore" }); + const proc = spawn(which.sync(cmd), args, { stdio: waitForExit ? ignoreStdout ? ["inherit", "ignore", "inherit"] : "inherit" : "ignore", detached: !waitForExit }); if (waitForExit) { const onCanceled = () => { proc.kill(); @@ -52,8 +52,7 @@ export async function exec(cmd, args, options = {}) { } else { proc.unref(); - // wait a short period in order to allow the process to start successfully before Node exits. - setTimeout(() => resolve({ exitCode: undefined }), 100); + resolve({ exitCode: undefined }); } })); }