Skip to content

Commit

Permalink
fix a problem where backslashes break rsync on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
pstadler committed Nov 11, 2014
1 parent 3269198 commit 97bff09
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/transport/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ ShellTransport.prototype.__transfer = function(files, remoteDir, options) {
}

var tmpTransferListFile = tempWrite.sync(files);
// escape backslashes (Windows)
var escapedTmpTransferListFile = tmpTransferListFile.replace(/\\/g, '\\\\');

var rsyncFlags = '-az' + (this.logger.debugEnabled() ? 'vv': '');
var _results = [];
Expand All @@ -93,8 +95,8 @@ ShellTransport.prototype.__transfer = function(files, remoteDir, options) {
, config.host, remoteDir);

var cmd = util.format('rsync --files-from %s %s --rsh="ssh -p%s%s" ./ %s'
, tmpTransferListFile, rsyncFlags, config.port || 22
, sshFlags, remoteUrl);
, escapedTmpTransferListFile, rsyncFlags
, config.port || 22, sshFlags, remoteUrl);

_results.push(this.exec(cmd, options));
return future.return();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "flightplan",
"description": "Library for streamlining application deployment or systems administration tasks",
"version": "0.4.3",
"version": "0.4.4",
"author": "Patrick Stadler <patrick.stadler@gmail.com>",
"keywords": [
"deploy",
Expand Down

0 comments on commit 97bff09

Please sign in to comment.