ssh-client-wrapper 1.5.2 → 1.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/rsyncExec.js +7 -1
  2. package/package.json +1 -1
package/lib/rsyncExec.js CHANGED
@@ -50,7 +50,13 @@ async function send(hostInfo, argSrc, dst, rsyncOpt = []) {
50
50
  const rshOpt = ["-e", `${sshCmd} ${sshArgs.join(" ")}`];
51
51
 
52
52
  const args = ["-avv", "--copy-unsafe-links", ...rshOpt, ...rsyncOpt, ...src, `${hostInfo.host}:${dst}`];
53
- const { dir: remoteDir } = path.parse(dst);
53
+ let remoteDir;
54
+ if (dst.endsWith("/")) {
55
+ remoteDir = dst;
56
+ } else {
57
+ const { dir } = path.parse(dst);
58
+ remoteDir = dir;
59
+ }
54
60
  debug("remoteDir=", remoteDir);
55
61
 
56
62
  if (remoteDir !== "" && remoteDir !== "/") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssh-client-wrapper",
3
- "version": "1.5.2",
3
+ "version": "1.5.3",
4
4
  "description": "wrapper library for open ssh client and rsync",
5
5
  "keywords": [
6
6
  "ssh",