Skip to content

Commit 97bff09

Browse files
committed
fix a problem where backslashes break rsync on Windows
1 parent 3269198 commit 97bff09

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/transport/shell.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ ShellTransport.prototype.__transfer = function(files, remoteDir, options) {
8080
}
8181

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

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

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

99101
_results.push(this.exec(cmd, options));
100102
return future.return();

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "flightplan",
33
"description": "Library for streamlining application deployment or systems administration tasks",
4-
"version": "0.4.3",
4+
"version": "0.4.4",
55
"author": "Patrick Stadler <[email protected]>",
66
"keywords": [
77
"deploy",

0 commit comments

Comments
 (0)