tasks/mongo-migrate.js
function run(cmd){

        var proc = require('child_process'),
            done = grunt.task.current.async(); // Tells Grunt that an async task is complete

        proc.exec(cmd,
            function(error, stdout, stderr){
                if(stderr){
                    grunt.log.writeln('ERROR: ' + stderr).error();
                }
                grunt.log.writeln(stdout);
                done(error);
            }
        );
    }
function run(cmd){

        var proc = require('child_process'),
            done = grunt.task.current.async(); // Tells Grunt that an async task is complete

        proc.exec(cmd,
            function(error, stdout, stderr){
                if(stderr){
                    grunt.log.writeln('ERROR: ' + stderr).error();
                }
                grunt.log.writeln(stdout);
                done(error);
            }
        );
    }
function run ( cmd ) { var proc = require ( 'child_process' ) , done = grunt . task . current . async ( ) ; // Tells Grunt that an async task is complete proc . exec ( cmd , function ( error , stdout , stderr ) { if ( stderr ) { grunt . log . writeln ( 'ERROR: ' + stderr ) . error ( ) ; } grunt . log . writeln ( stdout ) ; done ( error ) ; } ) ; }
Helper method to interface with the migrate bin file.
@param cmd Command that is going to be executed.
Helper method to interface with the migrate bin file .