Skip to content

Commit f0fc564

Browse files
author
Cam Pedersen
committed
Merge pull request #1 from gabrielpreston/patch-1
[minor] Adding in ability to provide a username option
2 parents 22fa042 + 990f1bf commit f0fc564

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)