From bba077fe4001a3f7764f556bcfc771ec17b8c5dc Mon Sep 17 00:00:00 2001 From: Florian Rappl Date: Sun, 25 Feb 2024 19:41:41 +0100 Subject: [PATCH] Don't use sigquit on windows --- src/utils/process.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/process.ts b/src/utils/process.ts index c90ec08..3f02135 100644 --- a/src/utils/process.ts +++ b/src/utils/process.ts @@ -1,7 +1,10 @@ import { exec } from 'child_process'; +import { platform } from 'os'; import { promisify } from 'util'; import { RunningProcess } from './types'; +const isWindows = platform() === 'win32'; + export const execAsync = promisify(exec); export const sleep = promisify(setTimeout); @@ -74,7 +77,12 @@ export function runAsync(cmd: string, cwd = process.cwd()): RunningProcess { const promise = waitEnd(); cp.kill('SIGTERM'); cp.kill('SIGKILL'); - cp.kill('SIGQUIT'); + + if (!isWindows) { + // does not work on Windows + cp.kill('SIGQUIT'); + } + cp.stdout.destroy(); cp.stderr.destroy(); return promise;