Skip to content

Commit

Permalink
Merge 739f683 into e5ed8de
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 30, 2019
2 parents e5ed8de + 739f683 commit 4859018
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,8 @@ const execa = (file, args, options) => {
return promise;
})();

const processDone = new Promise(resolve => {
const processDone = pFinally(new Promise(resolve => {
spawned.on('exit', (code, signal) => {
cleanup();

if (timedOut) {
resolvable.resolve([
{code, signal}, '', '', ''
Expand All @@ -281,17 +279,15 @@ const execa = (file, args, options) => {
});

spawned.on('error', error => {
cleanup();
resolve({error});
});

if (spawned.stdin) {
spawned.stdin.on('error', error => {
cleanup();
resolve({error});
});
}
});
}), cleanup);

function destroy() {
if (spawned.stdout) {
Expand Down

0 comments on commit 4859018

Please sign in to comment.