teambition / gulp-ssh

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

Logging "shell" method in to the console #21

Closed vmoshynskyi closed 9 years ago

vmoshynskyi commented 9 years ago

Hi there.

Is there's a way to log the response from "shell" method into the console simultaneously with execution?

E.g. I've been using implementation similar to below

gulpSSH
  .shell(['find /tmp'])
  .on('data', function(file) {
      file.contents.on('data', function(chunk) {
        process.stdout.write(chunk);
      });
  });

but after update to 0.4.0 it stopped working and it looks like .on('data', function(file) {}) method now returns File with the whole output.

Please advice.

zensh commented 9 years ago

Hi, I have released v0.4.1, which add a event "ssh2Data" for your purpose:

gulpSSH
  .shell(['find /tmp'])
  .on('ssh2Data', function(chunk) {
      process.stdout.write(chunk);
  });
vmoshynskyi commented 9 years ago

Thank you for quick update :thumbsup: