mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
pass 'detached:true' for diff tool (#56293)
This commit is contained in:
parent
6a9bc38da8
commit
e1ef69d99e
@ -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 });
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user