Make it possible to disable colors

Fixes #76
This commit is contained in:
Sindre Sorhus
2012-10-05 13:53:06 +02:00
parent 5d9257d908
commit 77fb081b93
2 changed files with 7 additions and 0 deletions

View File

@@ -9,8 +9,13 @@
var colors = require('colors');
var hogan = require('hogan.js');
var _ = require('lodash');
var nopt = require('nopt');
module.exports = hogan.Template.prototype.renderWithColors = function (context, partials, indent) {
if (nopt(process.argv).color === false) {
colors.mode = 'none';
}
context = _.extend({
yellow : function (s) { return s.yellow },
green : function (s) { return s.green },