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

Commit b63aac5

Browse files
author
jens
committed
retain compatible with old implementations
1 parent b4e7533 commit b63aac5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/scp.js

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

9292
exports.Client = Client;
9393

94-
exports.scp = function(client, src, dest, callback) {
95-
if (!client) {
96-
var client = new Client();
97-
client.on('error', callback);
94+
exports.scp = function(src, dest, client, callback) {
95+
if (typeof client === 'function') {
96+
callback = client;
97+
client = new Client();
9898
}
99+
client.on('error', callback);
99100
var parsed = client.parse(src);
100101
if (parsed.host && parsed.path) {
101102
cp2local(client, parsed, dest, callback);

0 commit comments

Comments
 (0)