jedrichards/grunt-rsync

some error with grunt watch

Closed this issue · 2 comments

grunt rsync:

rsync . yuji@jssmt_yuji:~/wwwroot/yuji.pro --rsh=ssh --recursive --delete --delete-excluded --checksum -rtv --exclude-from=/Volumes/HDD/Users/yuji/dev/speedometer/.rsyncignore

but with grunt watch, like:

watch: {
        files: ["*.html", "js/**", "css/**"],
        tasks: 'min rsync:remote'
    }

run 2 times, the command will change to:

rsync . yuji@jssmt_yuji:yuji@jssmt_yuji:~/wwwroot/yuji.pro --rsh=ssh --recursive --delete --delete-excluded --checksum -rtv --exclude-from=/Volumes/HDD/Users/yuji/dev/speedometer/.rsyncignore

and, error log:

Running "rsync:remote" (rsync) task
. > yuji@jssmt_yuji:yuji@jssmt_yuji:~/wwwroot/yuji.pro error
rsync . yuji@jssmt_yuji:yuji@jssmt_yuji:~/wwwroot/yuji.pro --rsh=ssh --recursive --delete --delete-excluded --checksum -rtv --exclude-from=/Volumes/HDD/Users/yuji/dev/speedometer/.rsyncignore
Error: rsync exited with code 12. rsync: mkdir "/home/yuji/yuji@jssmt_yuji:~/wwwroot/yuji.pro" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(605) [Receiver=3.0.9]
rsync: connection unexpectedly closed (8 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /SourceCache/rsync/rsync-42/rsync/io.c(452) [sender=2.6.9]

<WARN> Task "rsync:remote" failed. Use --force to continue. </WARN>

Hey, thanks for your comments and pull request! I actually tracked this down to a bug in rsyncwrapper (one of grunt-rsync's dependencies):

jedrichards/rsyncwrapper@7622786

With grunt watch the options object was being persisted across multiple invocations of the task, but the problem was that rsyncwrapper was directly manipulating options.dest by concatenating it with options.host to create the remote SSH location string. Each new time grunt watch re-ran the task options.host was getting re-concatenated.

If you do an npm update and get rsyncwrapper 0.0.9 I think your problem should be fixed. Let me know how you get on ...

Fixed, after update rsyncwrapper 0.10.0

thanks!!