spmjs / node-scp2

[MAINTAINER WANTED] A pure javascript scp program based on ssh2.
384 stars 96 forks source link

command line options do not work #115

Open xlambda opened 6 years ago

xlambda commented 6 years ago

The port and identify options do not work when using some the following config in package.json.

  "scripts": {
    "upload": "scp2 --port 32200 --identify d:\\\\id_rsa ./build/ gecko@example.com:/home/gecko/",
  },

Here's a simple patch. I do not quite understand how the .defaults method can be invoked in the module scope, but this patch seems to work correctly. diff node_modules/scp2/bin/scp2 node_modules/scp2/bin/scp2.1

175,177c176,179
<   console.log();
<   client.defaults(defaults);
<   client.scp(src, dest, function(err) {
---
>   console.log('ddefault', client.defaults, client.scp, client);
>   c = new client.Client();
>   c.defaults(defaults);
>   client.scp(src, dest, c, function(err) {