Skip to content

Commit 990f1bf

Browse files
Adding in ability to provide a username option to use on the remote system. I prefer this method over doing var options = { host : 'username@remotesystem' };
1 parent 32dbf15 commit 990f1bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ scp.send = function (options, cb) {
1414
'scp',
1515
'-r',
1616
options.file,
17-
options.host + ':' + options.path,
17+
(options.user == undefined ? '' : options.user+'@') + options.host + ':' + options.path,
1818
];
1919
exec(command.join(' '), function (err, stdout, stderr) {
2020
if (cb) {
@@ -32,7 +32,7 @@ scp.get = function (options, cb) {
3232
var command = [
3333
'scp',
3434
'-r',
35-
options.host + ':' + options.file,
35+
(options.user == undefined ? '' : options.user+'@') + options.host + ':' + options.file,
3636
options.path
3737
];
3838
exec(command.join(' '), function (err, stdout, stderr) {

0 commit comments

Comments
 (0)