From 97bff09074beccb58a3e6e76a2924fe16d7d7653 Mon Sep 17 00:00:00 2001 From: Patrick Stadler Date: Tue, 11 Nov 2014 11:40:47 +0100 Subject: [PATCH] fix a problem where backslashes break rsync on Windows --- lib/transport/shell.js | 6 ++++-- package.json | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/transport/shell.js b/lib/transport/shell.js index d0ec9f3..e891d54 100644 --- a/lib/transport/shell.js +++ b/lib/transport/shell.js @@ -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 = []; @@ -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(); diff --git a/package.json b/package.json index 025b57d..140c31f 100644 --- a/package.json +++ b/package.json @@ -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 ", "keywords": [ "deploy",