tasks/init.js
function(files, props, options) {
        options = _.defaults(options || {}, {
          process: function(contents) {
            return grunt.template.process(contents, {data: props, delimiters: 'init'});
          }
        });
        Object.keys(files).forEach(function(destpath) {
          var o = Object.create(options);
          var srcpath = files[destpath];
          // If srcpath is relative, match it against options.noProcess if
          // necessary, then make srcpath absolute.
          var relpath;
          if (srcpath && !grunt.file.isPathAbsolute(srcpath)) {
            if (o.noProcess) {
              relpath = srcpath.slice(pathPrefix.length);
              o.noProcess = grunt.file.isMatch({matchBase: true}, o.noProcess, relpath);
            }
            srcpath = helpers.getFile(srcpath);
          }
          // Copy!
          init.copy(srcpath, destpath, o);
        });
      }
function(files, props, options) {
        options = _.defaults(options || {}, {
          process: function(contents) {
            return grunt.template.process(contents, {data: props, delimiters: 'init'});
          }
        });
        Object.keys(files).forEach(function(destpath) {
          var o = Object.create(options);
          var srcpath = files[destpath];
          // If srcpath is relative, match it against options.noProcess if
          // necessary, then make srcpath absolute.
          var relpath;
          if (srcpath && !grunt.file.isPathAbsolute(srcpath)) {
            if (o.noProcess) {
              relpath = srcpath.slice(pathPrefix.length);
              o.noProcess = grunt.file.isMatch({matchBase: true}, o.noProcess, relpath);
            }
            srcpath = helpers.getFile(srcpath);
          }
          // Copy!
          init.copy(srcpath, destpath, o);
        });
      }
function ( files , props , options ) { options = _ . defaults ( options || { } , { process : function ( contents ) { return grunt . template . process ( contents , { data : props , delimiters : 'init' } ) ; } } ) ; Object . keys ( files ) . forEach ( function ( destpath ) { var o = Object . create ( options ) ; var srcpath = files [ destpath ] ; // If srcpath is relative, match it against options.noProcess if // necessary, then make srcpath absolute. var relpath ; if ( srcpath && ! grunt . file . isPathAbsolute ( srcpath ) ) { if ( o . noProcess ) { relpath = srcpath . slice ( pathPrefix . length ) ; o . noProcess = grunt . file . isMatch ( { matchBase : true } , o . noProcess , relpath ) ; } srcpath = helpers . getFile ( srcpath ) ; } // Copy! init . copy ( srcpath , destpath , o ) ; } ) ; }
Iterate over all files in the passed object, copying the source file to the destination, processing the contents.
Iterate over all files in the passed object copying the source file to the destination processing the contents .