jerrysu / gulp-rsync

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

recursive: true short-circuits #7

Open matthewwithanm opened 9 years ago

matthewwithanm commented 9 years ago

I had something that looked like this:

gulp.src(['dir1', 'dir2'])
  .pipe(rsync({...}));

This was causing an E2BIG error—I think because the number of matched files made the command too long. So I tried the recursive option, but that has no action. Tracing the issue, I found that it's short circuiting here because neither dir1 nor dir2 are the cwd.

Is this a bug? Why are those compared to cwd?

Thanks!

haizaar commented 9 years ago

I hit this one as well. Exactly the same way - tried to rsync bower's vendor dir, which definitely produces too many files for command line.

Then tried recusive: true, and all directories are filtered out.

As a workaround I'm using mysterious emptyDirectories: true option for now.

Alternatively, if you specify root: X and you have only one source dir and that source dir is the same as root, it will work as well.

I think

source.path === cwd && options.recursive

should be changed to

source.isDirectory() && options.recursive
zuckschwerdt commented 9 years ago

+1

markstos commented 6 years ago

I'm also using emptyDirectories:true to avoid the E2BIG error.