Commit 9b1a7263 9b1a726324363986bed60e7d71be6dc579f43f93 by renatodarrigo

Update colorizer.js to check for ANSICON and have colors on Windows

Check env variable 'ANSICON', and if exists, colorize the output.
1 parent 0e147d3d
......@@ -80,7 +80,7 @@ var Colorizer = function Colorizer() {
* @return String
*/
this.colorize = function colorize(text, styleName, pad) {
if ((fs.isWindows() && env['ANSICON'] == null) || !(styleName in styles)) {
if (fs.isWindows() || !env['ANSICON'] || !(styleName in styles)) {
return text;
}
return this.format(text, styles[styleName], pad);
......@@ -94,7 +94,7 @@ var Colorizer = function Colorizer() {
* @return String
*/
this.format = function format(text, style, pad) {
if ((fs.isWindows() && env['ANSICON'] == null) || !utils.isObject(style)) {
if (fs.isWindows() || !env['ANSICON'] || !utils.isObject(style)) {
return text;
}
var codes = [];
......