Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Fix output buffer is imcomplete working in child_process (#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 xzyfer committed Dec 13, 2016
1 parent a5fca4f commit 3c17b03
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 3c17b03

Please sign in to comment.