Skip to content

Commit

Permalink
Don't use sigquit on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianRappl committed Feb 25, 2024
1 parent 31daace commit bba077f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/utils/process.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit bba077f

Please sign in to comment.