Skip to content

Commit

Permalink
Fix output buffer is imcomplete working in child_process (sass#1834)
Browse files Browse the repository at this point in the history
Fix premature exit before the output stream is fully flushed
  • Loading branch information
ysugimoto authored and Guy Maliar committed Dec 17, 2016
1 parent 7e32a94 commit ec5aabc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 2 additions & 9 deletions bin/node-sass
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ec5aabc

Please sign in to comment.