Commit 3c17b033 by ysugimoto Committed by Michael Mifsud

Fix output buffer is imcomplete working in child_process (#1834)

Fix premature exit before the output stream is fully flushed
parent a5fca4f0
......@@ -10,6 +10,7 @@ var Emitter = require('events').EventEmitter,
glob = require('glob'),
sass = require('../lib'),
render = require('../lib/render'),
stdout = require('stdout-stream'),
stdin = require('get-stdin'),
fs = require('fs');
......@@ -160,15 +161,7 @@ function getEmitter() {
}
});
emitter.on('log', function(data) {
console.log(data);
});
emitter.on('done', function() {
if (!options.watch && !options.directory) {
process.exit();
}
});
emitter.on('log', stdout.write.bind(stdout));
return emitter;
}
......
......@@ -69,7 +69,8 @@
"node-gyp": "^3.3.1",
"npmlog": "^4.0.0",
"request": "^2.61.0",
"sass-graph": "^2.1.1"
"sass-graph": "^2.1.1",
"stdout-stream": "^1.4.0"
},
"devDependencies": {
"coveralls": "^2.11.8",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment