Skip to content
This repository was archived by the owner on Feb 5, 2022. It is now read-only.

Commit 83e1333

Browse files
committed
Merge pull request #38 from germanrio/Close_connection_scp_downloading
Fixes #30. Closes conection when downloading a single file
2 parents 56fada7 + 8ef95bf commit 83e1333

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/scp.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ function cp2local(client, src, dest, callback) {
8181
if (/\/$/.test(dest)) {
8282
dest = dest + path.basename(remote.path);
8383
}
84-
client.download(remote.path, dest, callback);
84+
client.download(remote.path, dest, function () {
85+
client.close();
86+
callback();
87+
});
8588
}
8689

8790
exports = module.exports = global_client;

0 commit comments

Comments
 (0)