gulp-rsync
gulp-rsync copied to clipboard
recursive: true short-circuits
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!
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
+1
I'm also using emptyDirectories:true to avoid the E2BIG error.