Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request gruntjs#153 from kylezeeuwen/master
Browse files Browse the repository at this point in the history
Add summary containing number of files created
  • Loading branch information
vladikoff committed Aug 6, 2014
2 parents bd59ba1 + 49dec51 commit 7cbdd9a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tasks/coffee.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down Expand Up @@ -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).');
}
};
Expand Down

0 comments on commit 7cbdd9a

Please sign in to comment.