Skip to content

Instantly share code, notes, and snippets.

@earnubs
Created May 28, 2014 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earnubs/ccef04e87be6e151a0d6 to your computer and use it in GitHub Desktop.
Save earnubs/ccef04e87be6e151a0d6 to your computer and use it in GitHub Desktop.
'use strict';
module.exports = function(grunt) {
grunt.registerMultiTask('blanket', 'Instrument files with Blanket.js', function() {
var blkt = require("blanket")({
"data-cover-flags": ['*.js']
});
this.files.forEach( function ( f ) {
f.src.forEach( function ( filepath ) {
blkt.instrument({
inputFile: grunt.file.read(filepath),
inputFileName: filepath.src
}, function ( instrumented ) {
grunt.file.write( f.dest, instrumented );
grunt.log.writeln( 'File ' + f.dest + ' instrumented.' );
});
});
});
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment