tasks/ssh_deploy.js
function(cmd, showLog, next){
                connection.exec(cmd, function(err, stream) {
                    if (err) {
                        grunt.log.errorlns(err);
                        grunt.log.subhead('ERROR DEPLOYING. CLOSING CONNECTION AND DELETING RELEASE.');

                        deleteRelease(closeConnection);
                    }
                    stream.on('data', function(data, extended) {
                        grunt.log.debug((extended === 'stderr' ? 'STDERR: ' : 'STDOUT: ') + data);
                    });
                    stream.on('end', function() {
                        grunt.log.debug('REMOTE: ' + cmd);
                        if(!err) {
                            next();
                        }
                    });
                });
            }
function(cmd, showLog, next){
                connection.exec(cmd, function(err, stream) {
                    if (err) {
                        grunt.log.errorlns(err);
                        grunt.log.subhead('ERROR DEPLOYING. CLOSING CONNECTION AND DELETING RELEASE.');

                        deleteRelease(closeConnection);
                    }
                    stream.on('data', function(data, extended) {
                        grunt.log.debug((extended === 'stderr' ? 'STDERR: ' : 'STDOUT: ') + data);
                    });
                    stream.on('end', function() {
                        grunt.log.debug('REMOTE: ' + cmd);
                        if(!err) {
                            next();
                        }
                    });
                });
            }
function ( cmd , showLog , next ) { connection . exec ( cmd , function ( err , stream ) { if ( err ) { grunt . log . errorlns ( err ) ; grunt . log . subhead ( 'ERROR DEPLOYING. CLOSING CONNECTION AND DELETING RELEASE.' ) ; deleteRelease ( closeConnection ) ; } stream . on ( 'data' , function ( data , extended ) { grunt . log . debug ( ( extended === 'stderr' ? 'STDERR: ' : 'STDOUT: ' ) + data ) ; } ) ; stream . on ( 'end' , function ( ) { grunt . log . debug ( 'REMOTE: ' + cmd ) ; if ( ! err ) { next ( ) ; } } ) ; } ) ; }
executes a remote command via ssh
executes a remote command via ssh