-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to force color #271
Conversation
We may need it if running via `sheel.js` for example.
/сс @tormozz48 @SwinX |
@@ -26,7 +26,7 @@ var styles = { | |||
'bgDefault': ['\033[49m', '\033[49m'] | |||
}; | |||
|
|||
var enabled = !process.env.NOCOLOR && tty.isatty(1) && tty.isatty(2); | |||
var enabled = process.env.COLOR || (!process.env.NOCOLOR && tty.isatty(1) && tty.isatty(2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems in this line checks about file descriptors point to TTY are being ignored if process.env.COLOR
is being set. This may lead to case when color output may occur, for example, in log file. Looks like this is not a correct behavior, output anywhere expect TTY has to be clean, without colors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you set process.env.COLOR
variable, you should know what you're doing.
@SwinX i'm trying to get this code works: var exec = require('child_process').exec,
child;
child = exec('enb make', { stdio: 'inherit' });
child.stdout.on('data', function(data) {
console.log(data);
}); Any suggestions? |
Sure, i can do smth like this: var make = require('enb/lib/server/server-middleware').createBuilder({
cdir: process.cwd()
});
make(path); but i think it's not right ;) |
@sbmaxx you can use JS API since v0.15.0: var enb = require('enb');
enb.make(['path/to/target-1', 'path/to/target-2']); See https://github.com/enb-make/enb/blob/master/lib/api/make.js#L6-L20 and https://github.com/enb-make/enb/blob/master/lib/api/run-server.js#L5-L19 This is what you need? |
After further discussion if was decided to merge. |
Fixed in |
🎉 |
We may need it if running via
shelljs
for example.