mirror of
https://github.com/toddbluhm/env-cmd.git
synced 2025-12-08 18:23:33 +00:00
fix: returning "true" instead of "void"
Apparently process.kill() returns a Boolean, so the early return will return a true||false rather than the void as per the func sig. This patch ensures we return void regardless of what process.kill() and process.exit() return. What they return may be dependent on node version and/or platform.
This commit is contained in:
parent
8f35b71651
commit
bc94223674
@ -89,10 +89,11 @@ export class TermSignals {
|
||||
*/
|
||||
public _terminateProcess (code?: number, signal?: NodeJS.Signals): void {
|
||||
if (signal !== undefined) {
|
||||
return process.kill(process.pid, signal)
|
||||
process.kill(process.pid, signal)
|
||||
return
|
||||
}
|
||||
if (code !== undefined) {
|
||||
return process.exit(code)
|
||||
process.exit(code)
|
||||
}
|
||||
throw new Error('Unable to terminate parent process successfully')
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user