Commit c543ddab c543ddabe77a7a1e1562be14853935e0462b709e by Nicolas Perriault

Merge pull request #491 from renatodarrigo/patch-1

refs #490 - checking for ANSICON on colorizer.js to have colors on Windows
2 parents 56dce225 10af8659
......@@ -33,6 +33,7 @@
var require = patchRequire(require);
var fs = require('fs');
var utils = require('utils');
var env = require('system').env;
exports.create = function create(type) {
"use strict";
......@@ -79,7 +80,7 @@ var Colorizer = function Colorizer() {
* @return String
*/
this.colorize = function colorize(text, styleName, pad) {
if (fs.isWindows() || !(styleName in styles)) {
if ((fs.isWindows() && !env['ANSICON']) || !(styleName in styles)) {
return text;
}
return this.format(text, styles[styleName], pad);
......@@ -93,7 +94,7 @@ var Colorizer = function Colorizer() {
* @return String
*/
this.format = function format(text, style, pad) {
if (fs.isWindows() || !utils.isObject(style)) {
if ((fs.isWindows() && !env['ANSICON']) || !utils.isObject(style)) {
return text;
}
var codes = [];
......