fix(child processes): now run detached

This commit is contained in:
Philipp Kunz 2018-10-28 19:18:42 +01:00
parent dcee2d6233
commit 4fe3775904

View File

@ -21,6 +21,7 @@ export interface IExecResult {
export interface IExecResultStreaming {
childProcess: cp.ChildProcess;
finalPromise: Promise<IExecResult>;
kill: () => void;
}
// -- SmartShell --
@ -70,7 +71,11 @@ export class Smartshell {
if (streamingArg) {
done.resolve({
childProcess: execChildProcess,
finalPromise: childProcessEnded.promise
finalPromise: childProcessEnded.promise,
kill: () => {
// this notation with the - kills the whole process group
process.kill(-execChildProcess.pid);
}
});
}