Skip to content

Commit 09b4a00

Browse files
early return if process has already been killed in #killProcess
1 parent b4c6878 commit 09b4a00

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/libraries/Executor.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ class Executor {
3737

3838
async #killProcess(process: ChildProcess): Promise<boolean> {
3939
let killed = false;
40+
41+
// If the process has already been killed, return true
42+
if (process.kill(0) === false) return true
43+
4044
if (os.platform() === 'win32') {
4145
const {error, stderr} = await this.#executeFile('taskkill', ['/pid', String(process.pid), '/t', '/f'])
4246
if (!error && !stderr) {

0 commit comments

Comments
 (0)