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

Fix output buffer is imcomplete working in child_process #1834

Merged
merged 9 commits into from
Dec 13, 2016
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions bin/node-sass
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ var Emitter = require('events').EventEmitter,
glob = require('glob'),
sass = require('../lib'),
render = require('../lib/render'),
stdout = require('stdout-stream'),
stdin = require('get-stdin'),
exit = require('exit'),
fs = require('fs');

/**
Expand Down Expand Up @@ -150,7 +152,7 @@ function getEmitter() {
}
console.error(err);
if (!options.watch) {
process.exit(1);
exit(1);
Copy link
Contributor

@xzyfer xzyfer Dec 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

process.exit is fine here because console.error is synchronous.

}
});

Expand All @@ -161,13 +163,12 @@ function getEmitter() {
});

emitter.on('log', function(data) {
Copy link
Contributor

@xzyfer xzyfer Dec 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emitter.on('log', stdout.write)

console.log(data);
// In nodejs <= 7.1.0, console.log cannot write output larger than 8275 bytes data.
stdout.write(data);
});

emitter.on('done', function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please delete the emitter.on('done' block all together.

if (!options.watch && !options.directory) {
process.exit();
}
// noop
});

return emitter;
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"async-foreach": "^0.1.3",
"chalk": "^1.1.1",
"cross-spawn": "^3.0.0",
"exit": "^0.1.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove.

"gaze": "^1.0.0",
"get-stdin": "^4.0.1",
"glob": "^7.0.3",
Expand All @@ -69,7 +70,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