Skip to content

Commit

Permalink
pass 'detached:true' for diff tool (microsoft#56293)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton authored Nov 3, 2023
1 parent 6a9bc38 commit e1ef69d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scripts/build/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 });
}
}));
}
Expand Down

0 comments on commit e1ef69d

Please sign in to comment.