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 {
|
export interface IExecResultStreaming {
|
||||||
childProcess: cp.ChildProcess;
|
childProcess: cp.ChildProcess;
|
||||||
finalPromise: Promise<IExecResult>;
|
finalPromise: Promise<IExecResult>;
|
||||||
|
kill: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -- SmartShell --
|
// -- SmartShell --
|
||||||
@ -70,7 +71,11 @@ export class Smartshell {
|
|||||||
if (streamingArg) {
|
if (streamingArg) {
|
||||||
done.resolve({
|
done.resolve({
|
||||||
childProcess: execChildProcess,
|
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