ssh-client-wrapper 2.10.0 → 2.10.1
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.
- package/lib/rsyncExec.js +6 -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,11 @@ async function recv (hostInfo, argSrc, dst, rsyncOpt, timeout) {
|
|
|
117
117
|
if (await isNewRsync(hostInfo)) {
|
|
118
118
|
args.unshift("--old-args");
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
|
|
121
|
+
// make destination directory if multi files will be transferd
|
|
122
|
+
if (argSrc.len > 1 || hasMagic(argSrc[0])) {
|
|
123
|
+
await fs.mkdir(dst, { recursive: true });
|
|
124
|
+
}
|
|
121
125
|
|
|
122
126
|
debug(`recv ${src} to ${dst}`);
|
|
123
127
|
debugVerbose(`recv: ${rsyncCmd} ${args.join(" ")}`);
|