From 49dec51d34e914ae95fa0c99caefc311f8d65128 Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 6 Aug 2014 09:16:59 +1000 Subject: [PATCH] Add summary containing number of files created --- tasks/coffee.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tasks/coffee.js b/tasks/coffee.js index 5eb07af..7b9094b 100644 --- a/tasks/coffee.js +++ b/tasks/coffee.js @@ -13,6 +13,11 @@ module.exports = function(grunt) { var chalk = require('chalk'); var _ = require('lodash'); + var actionCounts = { + fileCreated: 0, + mapCreated: 0 + }; + grunt.registerMultiTask('coffee', 'Compile CoffeeScript files into JavaScript', function() { var options = this.options({ bare: false, @@ -38,6 +43,10 @@ module.exports = function(grunt) { writeCompiledFile(f.dest, concatOutput(validFiles, options)); } }); + + grunt.log.writeln(actionCounts.fileCreated + ' files created.'); + grunt.log.writeln(actionCounts.mapCreated + ' source map files created.'); + }); var isLiterate = function(ext) { @@ -229,11 +238,13 @@ module.exports = function(grunt) { var writeCompiledFile = function(path, output) { if (writeFile(path, output)) { + actionCounts.fileCreated++; grunt.verbose.writeln('File ' + chalk.cyan(path) + ' created.'); } }; var writeSourceMapFile = function(path, output) { if (writeFile(path, output)) { + actionCounts.mapCreated++; grunt.verbose.writeln('File ' + chalk.cyan(path) + ' created (source map).'); } };