Skip to content
Myr

Small refactoring on `cleanup` option (#268)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by Sindre Sorhus · parent e5ed8de · Browse files · 1 file+3 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−6 removed

  • other:+3 added−6 removed

1 file+3 added−6 removed

modified:index.js+3 added-6 removed
265 unmodified lines
266 promise.resolve = extracted;267 return promise;268 })();269270 // TODO: Use native "finally" syntax when targeting Node.js 10270 const processDone = new Promise(resolve => {271 const processDone = pFinally(new Promise(resolve => {272 spawned.on('exit', (code, signal) => {272 cleanup();273273 if (timedOut) {274 resolvable.resolve([275 {code, signal}, '', '', ''276 ]);
2 unmodified lines
279 resolve({code, signal});280 });281282 spawned.on('error', error => {284 cleanup();283 resolve({error});284 });285286 if (spawned.stdin) {287 spawned.stdin.on('error', error => {290 cleanup();288 resolve({error});289 });290 }294 });291 }), cleanup);292293 function destroy() {294 if (spawned.stdout) {295 spawned.stdout.destroy();
167 unmodified lines