pure/tasks/license.js

19 lines
601 B
JavaScript
Raw Permalink Normal View History

2013-11-18 19:45:37 +00:00
'use strict';
module.exports = function (grunt) {
grunt.registerMultiTask('license', 'Stamps license banners on files.', function () {
var options = this.options({banner: ''}),
banner = grunt.template.process(options.banner),
tally = 0;
this.files.forEach(function (filePair) {
filePair.src.forEach(function (file) {
grunt.file.write(file, banner + grunt.file.read(file));
tally += 1;
});
});
grunt.log.writeln('Stamped license on ' + String(tally).cyan + ' files.');
});
};