teambition / gulp-ssh

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

Is there an sftp "progress" event I can connect to? #12

Closed skyzyx closed 8 years ago

skyzyx commented 9 years ago

It would be great if I could get a sense of how much longer, and/or where in the upload/download process, the SFTP action has.

zensh commented 9 years ago

demo:

gulp.task('sftp-read', function () {
  return gulpSSH.sftp('read', 'pm2.json')
    .on('data', function (chunk) {/*...do it*/})
    .pipe(gulp.dest(''));
});

You can calculate process precent (chunk size / total size) by youself.

0xorial commented 9 years ago

Could you provide demo code for 'write'? I tried similar approach as here, but callback was called only once in the very end..

0xorial commented 9 years ago

I have added a pull request with 'progress' stuff (dependent on pull request in ssh2-streams).

P.S. This is first time I am trying to contribute to multiple projects 'at once', so not 100% sure I did everything right...