Skip to content

Commit

Permalink
Fix bug: --no-color does note affect "FIXME!"
Browse files Browse the repository at this point in the history
  • Loading branch information
teppeis committed Apr 4, 2014
1 parent 0fb0d26 commit e91bce0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/cli.js
Expand Up @@ -15,24 +15,24 @@ var Logger = function(enableColor, stdout, stderr) {
this.stderr = stderr;
};

Logger.prototype.raw = function(msg) {
this.messages_.push(msg);
Logger.prototype.raw = function(msg, opt_color) {
this.messages_.push(this.color_ && opt_color ? opt_color(msg) : msg);
};

Logger.prototype.info = function(msg) {
this.messages_.push(msg);
this.raw(msg);
};

Logger.prototype.warn = function(msg) {
this.messages_.push(this.color_ ? clc.yellow(msg) : msg);
this.raw(msg, clc.yellow);
};

Logger.prototype.error = function(msg) {
this.messages_.push(this.color_ ? clc.red(msg) : msg);
this.raw(msg, clc.red);
};

Logger.prototype.success = function(msg) {
this.messages_.push(this.color_ ? clc.green(msg) : msg);
this.raw(msg, clc.green);
};

Logger.prototype.items = function(items) {
Expand Down Expand Up @@ -231,7 +231,7 @@ function main(argv, stdout, stderr, exit) {
if (needToFix) {
if (program.fixInPlace) {
fix(file, info);
log.raw(clc.cyanBright('FIXED!'));
log.raw(('FIXED!'), clc.cyan);
fixed++;
} else {
log.error('FAIL!');
Expand All @@ -250,7 +250,7 @@ function main(argv, stdout, stderr, exit) {
});

var total = ok + ng + fixed;
log.raw('');
log.info('');
if (ng) {
log.error(ng + ' of ' + total + ' files failed');
if (fixed) {
Expand Down

0 comments on commit e91bce0

Please sign in to comment.