ssh-client-wrapper 2.10.0 → 2.10.2

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 +5 -2
  2. package/package.json +1 -1
package/lib/rsyncExec.js CHANGED
@@ -3,7 +3,7 @@ const path = require("path");
3
3
  const fs = require("fs/promises");
4
4
  const debug = require("debug")("sshClientWrapper:debug:rsyncExec");
5
5
  const debugVerbose = require("debug")("sshClientWrapper:verbose:rsyncExec");
6
- const { glob } = require("glob");
6
+ const { glob, hasMagic } = require("glob");
7
7
 
8
8
  const { connect, retryWrapper, sshExec } = require("./sshExec.js");
9
9
  const { fork } = require("./fork.js");
@@ -117,7 +117,10 @@ async function recv (hostInfo, argSrc, dst, rsyncOpt, timeout) {
117
117
  if (await isNewRsync(hostInfo)) {
118
118
  args.unshift("--old-args");
119
119
  }
120
- await fs.mkdir(dst, { recursive: true });
120
+
121
+ // make destination directory
122
+ const dstDir = argSrc.len > 1 || hasMagic(argSrc[0]) ? dst : path.dirname(dst);
123
+ await fs.mkdir(dstDir, { recursive: true });
121
124
 
122
125
  debug(`recv ${src} to ${dst}`);
123
126
  debugVerbose(`recv: ${rsyncCmd} ${args.join(" ")}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssh-client-wrapper",
3
- "version": "2.10.0",
3
+ "version": "2.10.2",
4
4
  "description": "wrapper library for open ssh client and rsync",
5
5
  "keywords": [
6
6
  "ssh",