ssh-client-wrapper 2.9.1 → 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.
@@ -1,4 +1,3 @@
1
- version: "3.8"
2
1
  services:
3
2
  testbed:
4
3
  image: naoso5/test-sshd
package/lib/rsyncExec.js CHANGED
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  const path = require("path");
3
+ const fs = require("fs/promises");
3
4
  const debug = require("debug")("sshClientWrapper:debug:rsyncExec");
4
5
  const debugVerbose = require("debug")("sshClientWrapper:verbose:rsyncExec");
5
- const { glob } = require("glob");
6
+ const { glob, hasMagic } = require("glob");
6
7
 
7
8
  const { connect, retryWrapper, sshExec } = require("./sshExec.js");
8
9
  const { fork } = require("./fork.js");
@@ -117,6 +118,11 @@ async function recv (hostInfo, argSrc, dst, rsyncOpt, timeout) {
117
118
  args.unshift("--old-args");
118
119
  }
119
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
+ }
125
+
120
126
  debug(`recv ${src} to ${dst}`);
121
127
  debugVerbose(`recv: ${rsyncCmd} ${args.join(" ")}`);
122
128
  return retryWrapper(fork.bind(null, hostInfo, rsyncCmd, args, timeout, null, acceptableRsyncRetrunCodes), hostInfo);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssh-client-wrapper",
3
- "version": "2.9.1",
3
+ "version": "2.10.1",
4
4
  "description": "wrapper library for open ssh client and rsync",
5
5
  "keywords": [
6
6
  "ssh",
package/run_test_all.sh CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/bin/bash
2
2
 
3
3
  function cleanup(){
4
- docker-compose rm --stop --force testbed
4
+ docker compose rm --stop --force testbed
5
5
  }
6
6
 
7
7
  trap cleanup EXIT
8
8
  set -e -o pipefail
9
9
 
10
- docker-compose up testbed -d
10
+ docker compose up testbed -d
11
11
  export TEST_HOST=localhost
12
12
  export TEST_USER=testuser
13
13
  export TEST_PW=passw0rd
@@ -17,11 +17,11 @@ ssh-keygen -R '[localhost]:4100'
17
17
  npm run test
18
18
  echo local test success
19
19
 
20
- docker-compose run --build --rm tester
20
+ docker compose run --build --rm tester
21
21
  echo test on latest ubuntu success
22
22
 
23
- docker-compose run --build --rm tester-bullseye
23
+ docker compose run --build --rm tester-bullseye
24
24
  echo test on bullseye success
25
25
 
26
- docker-compose run --build --rm tester-buster
26
+ docker compose run --build --rm tester-buster
27
27
  echo test on buster success