mattijs/node-rsync — pull request #23 by jerrysu (2014-08-26 07:41:34+00:00)
Title: Automatically escape arguments when necessary

This fixes some very minor issues that I saw when using `node-rsync` on a
recent project.

Firstly, `npm test` doesn't run because the `test` directory is actually named
`tests`. I renamed it back to `test` since it is mocha's default.

Second, there is a typo in `buildOption()` for a parameter that is never used
in the code. I got rid of the parameter since it is currently causing every
value passed into `buildOption()` to be escaped.

Finally, I looked at `escapeShellArg()` since I was having issues with source
paths that contained spaces causing the rsync command to fail. Rather than
escaping every path, I modified `escapeShellArg` to determine whether the
argument needed to be escaped. I was able to safely apply this logic to the
values in `buildOption()`, source paths, and the destination. I also updated
the test since the behavior changed a bit.