Skip to content

Commit e1ef69d

Browse files
authored
pass 'detached:true' for diff tool (microsoft#56293)
1 parent 6a9bc38 commit e1ef69d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scripts/build/utils.mjs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function exec(cmd, args, options = {}) {
2828
const { ignoreExitCode, waitForExit = true, ignoreStdout } = options;
2929

3030
if (!options.hidePrompt) console.log(`> ${chalk.green(cmd)} ${args.join(" ")}`);
31-
const proc = spawn(which.sync(cmd), args, { stdio: waitForExit ? ignoreStdout ? ["inherit", "ignore", "inherit"] : "inherit" : "ignore" });
31+
const proc = spawn(which.sync(cmd), args, { stdio: waitForExit ? ignoreStdout ? ["inherit", "ignore", "inherit"] : "inherit" : "ignore", detached: !waitForExit });
3232
if (waitForExit) {
3333
const onCanceled = () => {
3434
proc.kill();
@@ -52,8 +52,7 @@ export async function exec(cmd, args, options = {}) {
5252
}
5353
else {
5454
proc.unref();
55-
// wait a short period in order to allow the process to start successfully before Node exits.
56-
setTimeout(() => resolve({ exitCode: undefined }), 100);
55+
resolve({ exitCode: undefined });
5756
}
5857
}));
5958
}

0 commit comments

Comments
 (0)