tasks/bushcaster.js
function forEachFilename( files, callback ) {
    files.forEach( function ( file ) {
      file.src.forEach( function ( src ) {
        if ( ! grunt.file.exists( src ) ) {
          grunt.verbose.writeln( 'source file "' + src + '" not found' );
          return false;
        }

        if ( grunt.file.isDir( src ) ) {
          grunt.verbose.writeln( 'source file "' + src + '" seems to be a directory' );
          return false;
        }

        var filename = path.relative( file.orig.cwd, src );

        callback( src, filename, file.dest, file.orig.cwd );
      });
    });
  }
function forEachFilename( files, callback ) {
    files.forEach( function ( file ) {
      file.src.forEach( function ( src ) {
        if ( ! grunt.file.exists( src ) ) {
          grunt.verbose.writeln( 'source file "' + src + '" not found' );
          return false;
        }

        if ( grunt.file.isDir( src ) ) {
          grunt.verbose.writeln( 'source file "' + src + '" seems to be a directory' );
          return false;
        }

        var filename = path.relative( file.orig.cwd, src );

        callback( src, filename, file.dest, file.orig.cwd );
      });
    });
  }
function forEachFilename ( files , callback ) { files . forEach ( function ( file ) { file . src . forEach ( function ( src ) { if ( ! grunt . file . exists ( src ) ) { grunt . verbose . writeln ( 'source file "' + src + '" not found' ) ; return false ; } if ( grunt . file . isDir ( src ) ) { grunt . verbose . writeln ( 'source file "' + src + '" seems to be a directory' ) ; return false ; } var filename = path . relative ( file . orig . cwd , src ) ; callback ( src , filename , file . dest , file . orig . cwd ) ; } ) ; } ) ; }
keeping it DRY
keeping it DRY