Skip to content

Commit dfaafb0

Browse files
committed
fix(spawnify) no exit, close events when wrong path of child process dir
1 parent ec732f6 commit dfaafb0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/spawnify.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@
169169

170170
if (error) {
171171
this._emit('error', newLine(error));
172+
this._emit('close');
173+
this._emit('exit');
172174
} else {
173175
child.stderr.setEncoding('utf-8');
174176
child.stdout.setEncoding('utf-8');
@@ -223,9 +225,6 @@
223225

224226
child.on('error', function(error) {
225227
self._emit('error', newLine(error));
226-
child = null;
227-
self._emit('exit');
228-
self._emit('close');
229228
});
230229

231230
child.on('exit', function() {

0 commit comments

Comments
 (0)