teambition / gulp-ssh

SSH and SFTP tasks for gulp
184 stars 38 forks source link

See command output on terminal #17

Closed 3m0 closed 9 years ago

3m0 commented 9 years ago

I'm running a command via ssh that I really have to see the output. Is it possible to log it to the console, maybe through an data event?

zensh commented 9 years ago

Yes, do it by data event

beinnova commented 9 years ago

Hi, Have you some example to show output of command/s ?

zensh commented 9 years ago
gulp.task('sftp-read', function () {
  return gulpSSH.sftp('read', 'pm2.json')
    .on('data', function (file) { console.log(file.contents.toString()) })
    .pipe(gulp.dest(''));
});
beinnova commented 9 years ago

Thanks!

luchillo17 commented 8 years ago

I have a gulp task in a server that executes a watch and all that, cool, but i can't see the log output of it, it never returns the shell logs until the command executed exits, which never happens in a watch command, and to exit the watch i have to exit the shell locally thus not getting any data events.

Is there a way to log the server ssh logs in a 1:1 way? not waiting for the exit of the executed command?