fix(child processes): now run detached
This commit is contained in:
parent
dcee2d6233
commit
4fe3775904
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user