Skip to content

Commit

Permalink
Merge pull request gruntjs#121 from radkodinev/colorized-output-with-…
Browse files Browse the repository at this point in the history
…chalk

Use chalk module to colorize terminal output
  • Loading branch information
sindresorhus committed Jan 6, 2014
2 parents 710c462 + 4770cd9 commit 69b6764
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
},
"dependencies": {
"less": "~1.5.1",
"grunt-lib-contrib": "~0.6.1"
"grunt-lib-contrib": "~0.6.1",
"chalk": "~0.4.0"
},
"devDependencies": {
"grunt-contrib-jshint": "~0.6.2",
Expand Down
5 changes: 3 additions & 2 deletions tasks/less.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports = function(grunt) {
var contrib = require('grunt-lib-contrib').init(grunt);

var path = require('path');
var chalk = require('chalk');
var less = require('less');

var lessOptions = {
Expand Down Expand Up @@ -67,15 +68,15 @@ module.exports = function(grunt) {
}
}, function (sourceMapContent) {
grunt.file.write(options.sourceMapFilename, sourceMapContent);
grunt.log.writeln('File ' + options.sourceMapFilename.cyan + ' created.');
grunt.log.writeln('File ' + chalk.cyan(options.sourceMapFilename) + ' created.');
});
}, function() {
if (compiledMin.length < 1) {
grunt.log.warn('Destination not written because compiled files were empty.');
} else {
var min = compiledMin.join(options.cleancss ? '' : grunt.util.normalizelf(grunt.util.linefeed));
grunt.file.write(destFile, min);
grunt.log.writeln('File ' + destFile.cyan + ' created.');
grunt.log.writeln('File ' + chalk.cyan(destFile) + ' created.');

// ...and report some size information.
if (options.report) {
Expand Down

0 comments on commit 69b6764

Please sign in to comment.