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

Commit b4e7533

Browse files
author
jens
committed
added parameter to scp to allow custom client
1 parent fb088c8 commit b4e7533

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/scp.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ exports = module.exports = global_client;
9191

9292
exports.Client = Client;
9393

94-
exports.scp = function(src, dest, callback) {
95-
var client = new Client();
96-
client.on('error', callback);
94+
exports.scp = function(client, src, dest, callback) {
95+
if (!client) {
96+
var client = new Client();
97+
client.on('error', callback);
98+
}
9799
var parsed = client.parse(src);
98100
if (parsed.host && parsed.path) {
99101
cp2local(client, parsed, dest, callback);

0 commit comments

Comments
 (0)