Skip to content

Commit

Permalink
Adds parameter to ToolRunner.killChildProcess to specify which signal…
Browse files Browse the repository at this point in the history
… to send microsoft#858
  • Loading branch information
Daniel Rosenberg committed Aug 14, 2022
1 parent 35bcc3f commit 219b903
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions node/toolrunner.ts
Expand Up @@ -1028,12 +1028,14 @@ export class ToolRunner extends events.EventEmitter {
}

/**
* Used to close child process by sending SIGNINT signal.
* It allows executed script to have some additional logic on SIGINT, before exiting.
* Sends a signal to kill the child process. If no argument is given, the SIGTERM signal will be sent.
* This allows the executed script to react to kill signals before being forcibly terminated.
*
* @param signal The signal to send to the child process (default is SIGTERM)
*/
public killChildProcess(): void {
public killChildProcess(signal?: string): void {
if (this.childProcess) {
this.childProcess.kill();
this.childProcess.kill(signal);
}
}
}
Expand Down

0 comments on commit 219b903

Please sign in to comment.