cob-cli 2.42.1 → 2.42.3

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.
@@ -56,7 +56,7 @@ async function _syncFiles(executionType, cmdEnv, from, to, extraOptions = []) {
56
56
  "--filter='merge " + path.resolve(__dirname,"rsyncFilter-post.txt") + "'",
57
57
  executionType == _syncFiles.COPY ? "-v" : "--dry-run"
58
58
  ].concat(productExtraOptions),
59
- { shell: true, env: { "RSYNC_RSH": "ssh -v -o ConnectTimeout=30 -o ServerAliveInterval=30 -o ServerAliveCountMax=30" } }
59
+ { shell: true, env: { "RSYNC_RSH": "ssh -o ConnectTimeout=30 -o ServerAliveInterval=30 -o ServerAliveCountMax=30" } }
60
60
  )
61
61
  .then((value) => {
62
62
  if (DEBUG)
@@ -71,10 +71,26 @@ async function _syncFiles(executionType, cmdEnv, from, to, extraOptions = []) {
71
71
  resolve();
72
72
  })
73
73
  .catch((err) => {
74
- /* 23 é a indicar que directorias não existem, ie, não é um problema por isso não devolve erro */
74
+ /* 23 indica transferência incompleta, vamos analisar porque queremos ignorar:
75
+ * remover directorias que não conhece (i.e. security)
76
+ * mudar ctime dos ficheiros (que sejam de outro owner)
77
+ */
75
78
  if (err.exitCode == 23) {
76
- count = RSYNC_RETRIES;
77
- resolve();
79
+ const relevantErrors = err.stderr
80
+ .split("\n")
81
+ .filter(line => !/^rsync: failed to set times on/.test(line))
82
+ .filter(line => !/^rsync error: some files/.test(line)) // linha final sempre que há erros
83
+ .filter(line => !/disabling multiplexing/.test(line)) // output irrelevante do ssh
84
+ .filter(line => !/No such file or directory/.test(line)) // quando dir base remoto não existe
85
+ .filter(line => !/write error: Broken pipe/.test(line) && !fs.existsSync(to)) // quando não existe localmente dir base
86
+ ;
87
+ if(relevantErrors.length == 0){
88
+ count = RSYNC_RETRIES;
89
+ resolve();
90
+ } else {
91
+ count = RSYNC_RETRIES;
92
+ reject(new Error(relevantErrors));
93
+ }
78
94
  } else if (count > RSYNC_RETRIES) {
79
95
  reject(new Error(err));;
80
96
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cob-cli",
3
- "version": "2.42.1",
3
+ "version": "2.42.3",
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": {