tasks/combine.js
function(inputIndex) {

            var inputPath = input[inputIndex].split("/");
            inputPath = inputPath[inputPath.length - 1];
            var path = outputIsPath ? output + inputPath : output;

            // write the input string to the output file name
            grunt.log.writeln('Writing Output: ' + (path).cyan);
            fs.writeFile(path, fileContents[inputIndex], 'utf8', function(err) {
                //console.log(fileContents[inputIndex]);
                if(err) {
                    clearTimeout(timer);
                    grunt.fail.warn("Could not write output '" + output + "' file.");
                }
                processedFiles++;
                if(processedFiles === fileContents.length) {
                    processedFiles = 0;
                    fileContents = [];

                    var endtime = (new Date()).getTime();
                    grunt.log.writeln('Combine task completed in ' + ((endtime - starttime) / 1000) + ' seconds');
                    clearTimeout(timer);

                    done();
                }
            });
        }
function(inputIndex) {

            var inputPath = input[inputIndex].split("/");
            inputPath = inputPath[inputPath.length - 1];
            var path = outputIsPath ? output + inputPath : output;

            // write the input string to the output file name
            grunt.log.writeln('Writing Output: ' + (path).cyan);
            fs.writeFile(path, fileContents[inputIndex], 'utf8', function(err) {
                //console.log(fileContents[inputIndex]);
                if(err) {
                    clearTimeout(timer);
                    grunt.fail.warn("Could not write output '" + output + "' file.");
                }
                processedFiles++;
                if(processedFiles === fileContents.length) {
                    processedFiles = 0;
                    fileContents = [];

                    var endtime = (new Date()).getTime();
                    grunt.log.writeln('Combine task completed in ' + ((endtime - starttime) / 1000) + ' seconds');
                    clearTimeout(timer);

                    done();
                }
            });
        }
function ( inputIndex ) { var inputPath = input [ inputIndex ] . split ( "/" ) ; inputPath = inputPath [ inputPath . length - 1 ] ; var path = outputIsPath ? output + inputPath : output ; // write the input string to the output file name grunt . log . writeln ( 'Writing Output: ' + ( path ) . cyan ) ; fs . writeFile ( path , fileContents [ inputIndex ] , 'utf8' , function ( err ) { //console.log(fileContents[inputIndex]); if ( err ) { clearTimeout ( timer ) ; grunt . fail . warn ( "Could not write output '" + output + "' file." ) ; } processedFiles ++ ; if ( processedFiles === fileContents . length ) { processedFiles = 0 ; fileContents = [ ] ; var endtime = ( new Date ( ) ) . getTime ( ) ; grunt . log . writeln ( 'Combine task completed in ' + ( ( endtime - starttime ) / 1000 ) + ' seconds' ) ; clearTimeout ( timer ) ; done ( ) ; } } ) ; }
Writes the processed input file to the specified output name.
@for grunt-combine
@method findAndReplaceTokens
Writes the processed input file to the specified output name .