gulp-rsync icon indicating copy to clipboard operation
gulp-rsync copied to clipboard

recursive: true short-circuits

Open matthewwithanm opened this issue 11 years ago • 3 comments

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!

matthewwithanm avatar Oct 17 '14 22:10 matthewwithanm

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

haizaar avatar Dec 10 '14 16:12 haizaar

+1

zuckschwerdt avatar Jun 22 '15 13:06 zuckschwerdt

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

markstos avatar Aug 24 '18 18:08 markstos