cob-cli 2.43.9 → 2.43.11

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.
@@ -100,11 +100,11 @@ async function _syncFiles(executionType, cmdEnv, from, to, extraOptions = [], ar
100
100
  count = RSYNC_RETRIES;
101
101
  reject(new Error(relevantErrors));
102
102
  }
103
- } else if (count > RSYNC_RETRIES) {
103
+ } else if (( count + 1 ) >= RSYNC_RETRIES) {
104
104
  reject(new Error(err));;
105
105
  } else {
106
106
  if (args.verbose > 1)
107
- console.log("warning".yellow + " rsync '" + (product).blue + "': attempt " + (count + 1) + " failed with code " + err.exitCode);
107
+ console.log("warning".yellow + " rsync '" + (product).blue + "': attempt " + (count + 1) + " of " + RSYNC_RETRIES + " failed with code " + err.exitCode);
108
108
  }
109
109
  });
110
110
  count++;
@@ -1,5 +1,6 @@
1
1
  const execa = require('execa');
2
2
  const fs = require('fs-extra');
3
+ const path = require('path');
3
4
  const { resolveCobPath } = require("./common_syncFiles");
4
5
 
5
6
  const DEBUG = false;
@@ -23,8 +24,10 @@ async function syncFile(server, localFile) {
23
24
  "--prune-empty-dirs",
24
25
  "--chmod=Fg+w",
25
26
  "--no-perms",
27
+ "--no-t",
26
28
  "--filter='merge " + path.resolve(__dirname,"rsyncFilter-pre.txt") + "'",
27
- "--filter='merge " + path.resolve(__dirname,"rsyncFilter-post.txt") + "'"])
29
+ "--filter='merge " + path.resolve(__dirname,"rsyncFilter-post.txt") + "'"],
30
+ { shell: true, env: { "RSYNC_RSH": "ssh -o ConnectTimeout=30 -o ServerAliveInterval=30 -o ServerAliveCountMax=30" } })
28
31
  .then(count = RSYNC_RETRIES)
29
32
  .catch(async (err) => {
30
33
  // exitCode 23 indicam que o ficheiro não existe na origem. Temod de apagar no destino.
@@ -37,8 +40,8 @@ async function syncFile(server, localFile) {
37
40
  await execa('ssh', [server, "rm -rf " + remoteFileDir]).catch({});
38
41
  }
39
42
  count = RSYNC_RETRIES;
40
- } else if (count > RSYNC_RETRIES) {
41
- if (DEBUG) console.log("rsync '" + productScopeFilePath + "': failed with " + err.exitCode + " -> " + err.message);
43
+ } else if ((count + 1)> RSYNC_RETRIES) {
44
+ if (DEBUG) console.log("rsync '" + productScopeFilePath + "': failed with " + err.exitCode + " -> " + err.message, err);
42
45
  throw err;
43
46
  } else {
44
47
  if (DEBUG) console.log("rsync '" + productScopeFilePath + "': attempt " + (count + 1) + " failed with code " + err.exitCode);
@@ -47,4 +50,4 @@ async function syncFile(server, localFile) {
47
50
  count++;
48
51
  }
49
52
  }
50
- exports.syncFile = syncFile;
53
+ exports.syncFile = syncFile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cob-cli",
3
- "version": "2.43.9",
3
+ "version": "2.43.11",
4
4
  "description": "A command line utility to help Cult of Bits partners develop with higher speed and reusing common code and best practices.",
5
5
  "preferGlobal": true,
6
6
  "repository": {