fix(core): update
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartshell',
|
||||
version: '3.0.4',
|
||||
description: 'shell actions designed as promises'
|
||||
version: '3.0.5',
|
||||
description: 'A library for executing shell commands using promises.'
|
||||
}
|
||||
|
@ -14,8 +14,10 @@ export interface IExecResult {
|
||||
export interface IExecResultStreaming {
|
||||
childProcess: cp.ChildProcess;
|
||||
finalPromise: Promise<IExecResult>;
|
||||
kill: () => void;
|
||||
terminate: () => void;
|
||||
kill: () => Promise<void>;
|
||||
terminate: () => Promise<void>;
|
||||
keyboardInterrupt: () => Promise<void>;
|
||||
customSignal: (signalArg: plugins.smartexit.TProcessSignal) => Promise<void>;
|
||||
}
|
||||
|
||||
export class Smartshell {
|
||||
@ -114,13 +116,21 @@ export class Smartshell {
|
||||
done.resolve({
|
||||
childProcess: execChildProcess,
|
||||
finalPromise: childProcessEnded.promise,
|
||||
kill: () => {
|
||||
kill: async () => {
|
||||
console.log(`running tree kill with SIGKILL on process ${execChildProcess.pid}`);
|
||||
plugins.treeKill(execChildProcess.pid, 'SIGKILL');
|
||||
await plugins.smartexit.SmartExit.killTreeByPid(execChildProcess.pid, 'SIGKILL');
|
||||
},
|
||||
terminate: () => {
|
||||
terminate: async () => {
|
||||
console.log(`running tree kill with SIGTERM on process ${execChildProcess.pid}`);
|
||||
plugins.treeKill(execChildProcess.pid, 'SIGTERM');
|
||||
await plugins.smartexit.SmartExit.killTreeByPid(execChildProcess.pid, 'SIGTERM');
|
||||
},
|
||||
keyboardInterrupt: async () => {
|
||||
console.log(`running tree kill with SIGINT on process ${execChildProcess.pid}`);
|
||||
await plugins.smartexit.SmartExit.killTreeByPid(execChildProcess.pid, 'SIGINT');
|
||||
},
|
||||
customSignal: async (signalArg: plugins.smartexit.TProcessSignal) => {
|
||||
console.log(`running tree kill with custom signal ${signalArg} on process ${execChildProcess.pid}`);
|
||||
await plugins.smartexit.SmartExit.killTreeByPid(execChildProcess.pid, signalArg);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@ -4,8 +4,3 @@ import * as smartpromise from '@push.rocks/smartpromise';
|
||||
import which from 'which';
|
||||
|
||||
export { smartdelay, smartexit, smartpromise, which };
|
||||
|
||||
// third party
|
||||
import treeKill from 'tree-kill';
|
||||
|
||||
export { treeKill };
|
||||
|
Reference in New Issue
Block a user