Skip to content

Commit

Permalink
fix: keep shutdown logs
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Jun 5, 2023
1 parent 07934e2 commit 3b7dec0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/createSpawn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ export const createSpawn = (

if (abortSignal) {
const kill = () => {
processPromise.kill();
// eslint-disable-next-line promise/prefer-await-to-then
processPromise.kill().finally(() => {
processPromise.stdout.off('data', onStdout);
processPromise.stderr.off('data', onStderr);
});
};

abortSignal.addEventListener('abort', kill, {
Expand Down

0 comments on commit 3b7dec0

Please sign in to comment.