jerrysu / gulp-rsync

Gulp plugin for deploying files via rsync
119 stars 51 forks source link

passing custom options to rsync #17

Closed stigmergic closed 7 years ago

stigmergic commented 9 years ago

I need to pass rsync-path in order to set the user to root, passing custom options like this doesn't work:

var gulp = require('gulp');
var rsync = require('gulp-rsync');

gulp.task('deploy', function() {
  gulp.src('build/**')
    .pipe(rsync({
      username: 'user',
      hostname: 'host',
      destination: '~/',
      options: {
        "rsync-path": "sudo rsync"
      }
    }));
});

Adding the following to index.js, after line 97 (https://github.com/jerrysu/gulp-rsync/blob/master/index.js#L97) picks up the options to add to the rsync command properly.

if (options.options) {
         for (var key in options.options) { config.options[key] = options.options[key]; }
}

Is there a better way to accomplish this?

JBerendes commented 9 years ago

I just wanted to +1 this. It works quite well!

JBerendes commented 9 years ago

tested on godaddy ... http://www.htpcbeginner.com/install-rsync-on-godaddy-hosting-account/

yalemarc commented 9 years ago

Is there anyway to include username and password? Tried to use gulp-ssh but only works on single files and I need to upload an entire folder. Site suggested rsync but need to be able to pass security info.

jchaney01 commented 8 years ago

@yalemarc Same here.

collnwalkr commented 7 years ago

thank you @stigmergic this fixed my problem

TCB13 commented 7 years ago

This would be nice, I also need other custom options... Can someone PR this?

ebaskoro commented 7 years ago

This feature is now included in version 0.0.7. Thank you @stigmergic for your PR. Please keep them coming :+1: