Closed dimw closed 9 years ago
var gulp = require('gulp');
var GulpSSH = require('gulp-ssh');
gulp.task('default', function (completed) {
var gulpSSH = new GulpSSH({
ignoreErrors: false,
sshConfig: {
host: 'example.com',
port: 22,
username: 'root',
password: ''
}
});
gulpSSH
.on('error', function (err) {
completed('Completed with errors!');
})
.on('end', function(){
completed();
});
return gulpSSH
.exec(['uptime']);
});
Currently, the gulp task ends in undefined state when connecting to a non-existing server or with wrong credentials. Instead, an error event should be fired to allow proper error handling.
gulpfile.js for testing: