diff --git a/lib/ssh.js b/lib/ssh.js index 8d562c9..2d44564 100644 --- a/lib/ssh.js +++ b/lib/ssh.js @@ -28,7 +28,6 @@ module.exports = function (opt) { }) .connect(opt); conn.once('end', () => agent.destroy()); - return agent; } catch (err) { handleError(err); @@ -40,4 +39,6 @@ module.exports = function (opt) { agent.destroy(); throw err; } + + return agent; };