From 8d8b90488394ce98634839323f015fa1cb62d56c Mon Sep 17 00:00:00 2001 From: Patrick Stadler Date: Wed, 5 Mar 2014 08:47:26 +0100 Subject: [PATCH] SSHTransport#exec(cmd, options) now passes options.exec to ssh2#exec(). close #7 --- lib/transport/ssh.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/transport/ssh.js b/lib/transport/ssh.js index 8fc01fe..40ed1c6 100644 --- a/lib/transport/ssh.js +++ b/lib/transport/ssh.js @@ -16,10 +16,8 @@ function SSHTransport(flight, target) { _fiber.run(); }); - this.connection.on('close', function() { - // TODO - }); - + var options = util._extend({}, this.target); // clone + delete options.exec; this.connection.connect(this.target); return Fiber.yield(); @@ -37,7 +35,7 @@ SSHTransport.prototype.__exec = function(cmd, args, options) { cmd = cmd + (args ? ' ' + args : ''); this.logger.command(cmd); - var execOpts = options.exec || this.config.exec || {}; + var execOpts = options.exec || this.target.exec || {}; this.connection.exec(cmd, execOpts, function(err, stream) { if(err) { // TODO