ssh-client-wrapper 2.12.4 → 2.13.0

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,8 +1,7 @@
1
- "use strict";
2
- const fs = require("fs-extra");
3
- const path = require("path");
1
+ import fs from "fs-extra";
2
+ import path from "path";
4
3
 
5
- const { sshExec } = require("../../lib/sshExec.js");
4
+ import { sshExec } from "../../lib/sshExec.js";
6
5
 
7
6
  /*
8
7
  * test directory tree
@@ -50,7 +49,7 @@ const nonExisting = "ARSSH_nonExisting";
50
49
  /**
51
50
  *
52
51
  */
53
- async function createLocalFiles() {
52
+ export async function createLocalFiles() {
54
53
  const localDir2 = path.join(localRoot, "hoge");
55
54
  const promises = [];
56
55
  await fs.mkdir(localRoot);
@@ -65,7 +64,7 @@ async function createLocalFiles() {
65
64
  /**
66
65
  *
67
66
  */
68
- async function clearLocalTestFiles() {
67
+ export async function clearLocalTestFiles() {
69
68
  return fs.remove(localRoot);
70
69
  }
71
70
 
@@ -73,7 +72,7 @@ async function clearLocalTestFiles() {
73
72
  *
74
73
  * @param hostInfo
75
74
  */
76
- async function createRemoteFiles(hostInfo) {
75
+ export async function createRemoteFiles(hostInfo) {
77
76
  //create remote files
78
77
  await sshExec(hostInfo, `mkdir -p ${remoteRoot}/hoge`);
79
78
  await sshExec(hostInfo, `mkdir -p ${remoteEmptyDir}`);
@@ -87,18 +86,16 @@ async function createRemoteFiles(hostInfo) {
87
86
  *
88
87
  * @param hostInfo
89
88
  */
90
- async function clearRemoteTestFiles(hostInfo) {
89
+ export async function clearRemoteTestFiles(hostInfo) {
91
90
  return sshExec(hostInfo, `rm -fr ${remoteRoot}`);
92
91
  }
93
92
 
94
- module.exports.createLocalFiles = createLocalFiles;
95
- module.exports.createRemoteFiles = createRemoteFiles;
96
- module.exports.clearLocalTestFiles = clearLocalTestFiles;
97
- module.exports.clearRemoteTestFiles = clearRemoteTestFiles;
98
- module.exports.localRoot = localRoot;
99
- module.exports.localEmptyDir = localEmptyDir;
100
- module.exports.localFiles = localFiles;
101
- module.exports.nonExisting = nonExisting;
102
- module.exports.remoteRoot = remoteRoot;
103
- module.exports.remoteEmptyDir = remoteEmptyDir;
104
- module.exports.remoteFiles = remoteFiles;
93
+ export {
94
+ localRoot,
95
+ localEmptyDir,
96
+ localFiles,
97
+ nonExisting,
98
+ remoteRoot,
99
+ remoteEmptyDir,
100
+ remoteFiles
101
+ };
package/.eslintrc.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "env": {
3
- "browser": true,
4
- "commonjs": true,
5
- "es2021": true
6
- },
7
- "extends": ["standard"],
8
- "overrides": [
9
- {
10
- "env": {
11
- "node": true
12
- },
13
- "files": [
14
- ".eslintrc.{js,cjs}"
15
- ],
16
- "parserOptions": {
17
- "sourceType": "script"
18
- }
19
- }
20
- ],
21
- "parserOptions": {
22
- "ecmaVersion": "latest"
23
- },
24
- "rules": {
25
- "semi": [
26
- "error",
27
- "always"
28
- ],
29
- "quotes": [
30
- "error",
31
- "double"
32
- ]
33
- }
34
- }
@@ -1,22 +0,0 @@
1
- name: publish npm package
2
- on:
3
- push:
4
- tags:
5
- - 'v*'
6
- jobs:
7
- test:
8
- uses: ./.github/workflows/run_test.yml
9
- publish-npm:
10
- needs:
11
- - test
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v3
15
- - uses: actions/setup-node@v3
16
- with:
17
- node-version: 20
18
- registry-url: https://registry.npmjs.org/
19
- - run: npm ci
20
- - run: npm publish
21
- env:
22
- NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
@@ -1,28 +0,0 @@
1
- {
2
- "env": {
3
- "node": true,
4
- "mocha": true,
5
- "es6": true
6
- },
7
- "settings": {
8
- "node": {
9
- "allowModules": [
10
- "chai",
11
- "chai-fs",
12
- "chai-as-promised",
13
- "sinon",
14
- "sinon-chai",
15
- "fs-extra",
16
- "rewire"
17
- ]
18
- }
19
- },
20
- "plugins": [
21
- "chai-expect",
22
- "chai-friendly"
23
- ],
24
- "rules": {
25
- "no-unused-expressions": 0,
26
- "chai-friendly/no-unused-expressions": 2
27
- }
28
- }