@cyberalien/deploy-utils 0.0.5 → 0.0.7

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/ssh/exec.js CHANGED
@@ -18,11 +18,11 @@ function execSFTPCommand(client, cmd, log = false) {
18
18
  });
19
19
  });
20
20
  stream.stdout.on("data", (data) => {
21
- if (log) console.log(`${data}`);
21
+ if (log) process.stdout.write(data);
22
22
  stdout += `${data}`;
23
23
  });
24
24
  stream.stderr.on("data", (data) => {
25
- if (log) console.error(`${data}`);
25
+ if (log) process.stderr.write(data);
26
26
  stderr += `${data}`;
27
27
  });
28
28
  });
package/lib/ssh/shell.js CHANGED
@@ -12,12 +12,11 @@ function execSFTPCommandWithShell(client, cmd) {
12
12
  resolve(code);
13
13
  });
14
14
  stream.stdout.on("data", (data) => {
15
- const content = `${data}`;
16
- if (content.includes("Ok to proceed? (y)")) stream.write("y\n");
17
- console.log(content);
15
+ process.stdout.write(data);
16
+ if (`${data}`.includes("Ok to proceed? (y)")) stream.write("y\n");
18
17
  });
19
18
  stream.stderr.on("data", (data) => {
20
- console.error(`${data}`);
19
+ process.stderr.write(data);
21
20
  });
22
21
  stream.write(`${cmd} && exit\n`);
23
22
  });
package/lib/ssh/upload.js CHANGED
@@ -19,7 +19,10 @@ function uploadSFTPFile(sftp, remoteFile, content) {
19
19
  */
20
20
  function putSFTPFile(sftp, localFile, remoteFile) {
21
21
  return new Promise((resolve, reject) => {
22
- sftp.fastPut(localFile, remoteFile, (err) => {
22
+ sftp.fastPut(localFile, remoteFile, {
23
+ concurrency: 1,
24
+ chunkSize: 524288
25
+ }, (err) => {
23
26
  if (err) {
24
27
  reject(err);
25
28
  return;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "description": "Functions for deploying stuff.",
5
5
  "author": "Vjacheslav Trushkin",
6
- "version": "0.0.5",
6
+ "version": "0.0.7",
7
7
  "license": "UNLICENSED",
8
8
  "homepage": "https://cyberalien.dev/",
9
9
  "sideEffects": false,