Skip to content

Commit eb1d565

Browse files
author
Cam Pedersen
committed
[minor] implement .send()
1 parent 8c7a20b commit eb1d565

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

scp.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,18 @@ var scp = module.exports = {};
1010
* Transfer a file to a remote host
1111
*/
1212
scp.send = function (options, cb) {
13-
exec ('scp ', function () {
14-
cb(arguments);
13+
var command = [
14+
'scp',
15+
'-r',
16+
options.file,
17+
options.host + ':' + options.path,
18+
];
19+
exec(command.join(' '), function (err, stdout, stderr) {
20+
if (cb) {
21+
cb(err, stdout, stderr);
22+
} else {
23+
if (err) throw new Error(err);
24+
}
1525
});
1626
}
1727

0 commit comments

Comments
 (0)