cob-cli 2.45.0 → 2.46.0-beta.2

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/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ nodejs 16.20.2
@@ -1,5 +1,9 @@
1
1
  const path = require('path');
2
2
 
3
+ if(process.platform === 'win32'){
4
+ return;
5
+ }
6
+
3
7
  /* Autocomplete Component*/
4
8
  var omelette = require('omelette');
5
9
  const commandStructure = {
@@ -22,4 +26,4 @@ if (~process.argv.indexOf('--setup')) {
22
26
  if (~process.argv.indexOf('--cleanup')) {
23
27
  console.log("Cleaning...")
24
28
  completion.cleanupShellInitFile()
25
- }
29
+ }
@@ -31,7 +31,14 @@ async function checkWorkingCopyCleanliness(testNotDetached=true) {
31
31
  /* ************************************ */
32
32
  function checkConnectivity(server) {
33
33
  const execa = require('execa');
34
- return execa('ssh', ["-o", "StrictHostKeyChecking=no", "-o", "PreferredAuthentications=publickey", "-o", "BatchMode=yes", "-o", "ConnectTimeout=15", server, "test -w /etc/recordm/services/com.cultofbits.web.integration.properties && exit || exit 1"])
34
+ return execa('ssh', [
35
+ "-o", "StrictHostKeyChecking=no",
36
+ "-o", "PreferredAuthentications=publickey",
37
+ "-o", "BatchMode=yes",
38
+ "-o", "ConnectTimeout=15",
39
+ server,
40
+ "test -w /etc/recordm/services/com.cultofbits.web.integration.properties && exit || exit 1"
41
+ ])
35
42
  }
36
43
 
37
44
  /* ************************************ */
@@ -5,7 +5,7 @@ const { getKeypress } = require("../task_lists/common_helpers");
5
5
 
6
6
  /* ************************************ */
7
7
  const COB_PRODUCTS = ["recordm", "integrationm", "recordm-importer", "reportm", "userm", "confm", "others"];
8
- const DEBUG = false;
8
+
9
9
  _syncFiles.TEST = "Test equality";
10
10
  _syncFiles.DIFF = "Get differences";
11
11
  _syncFiles.COPY = "Copy";
@@ -45,29 +45,35 @@ async function _syncFiles(executionType, cmdEnv, from, to, extraOptions = [], ar
45
45
  while (count < RSYNC_RETRIES) {
46
46
  if (args.verbose > 2)
47
47
  console.log("rsync".bold +" '" + (product).blue + "': attempt " + (count + 1));
48
- await execa('rsync',
49
- [
50
- fromPath,
51
- toPath,
52
- "-acvi",
53
- "--delete",
54
- "--chmod=g+w",
55
- "--no-perms",
56
- "--no-t",
57
- "--filter='merge " + path.resolve(__dirname,"rsyncFilter-pre.txt") + "'",
58
- hasRsyncFilter ? "--filter='merge " + cmdEnv.rsyncFilter + "'" : "",
59
- "--filter='merge " + path.resolve(__dirname,"rsyncFilter-post.txt") + "'",
60
- executionType == _syncFiles.COPY ? "-v" : "--dry-run"
61
- ].concat(productExtraOptions),
62
- { shell: true, env: { "RSYNC_RSH": "ssh -o ConnectTimeout=30 -o ServerAliveInterval=30 -o ServerAliveCountMax=30" } }
63
- )
48
+ const rsyncArgs = [
49
+ fromPath,
50
+ toPath,
51
+ "-acvi",
52
+ "--delete",
53
+ "--chmod=g+w",
54
+ "--no-perms",
55
+ "--no-t",
56
+ "--filter='merge " + path.resolve(__dirname,"rsyncFilter-pre.txt") + "'",
57
+ hasRsyncFilter ? "--filter='merge " + cmdEnv.rsyncFilter + "'" : "",
58
+ "--filter='merge " + path.resolve(__dirname,"rsyncFilter-post.txt") + "'",
59
+ executionType == _syncFiles.COPY ? "-v" : "--dry-run"
60
+ ].concat(productExtraOptions)
61
+ if (args.verbose > 3) {
62
+ console.log('rsync', rsyncArgs.join(' '))
63
+ }
64
+ await execa('rsync', rsyncArgs, {
65
+ shell: true,
66
+ env: { "RSYNC_RSH": "ssh -o ConnectTimeout=30 -o ServerAliveInterval=30 -o ServerAliveCountMax=30" }
67
+ })
64
68
  .then((value) => {
65
- if (args.verbose > 2)
69
+ if (args.verbose > 3)
66
70
  console.log("rsync".bold +" '" + (product).blue + "': " + "success".green + " " + value.stdout);
67
71
 
68
72
  let result = _formatRsyncOutput(product, value.stdout);
69
73
  if (args.verbose > 2)
70
74
  console.log("rsync '" + product + "': success " + result);
75
+ else if (args.verbose > 1)
76
+ console.log("rsync '" + product + "': success ");
71
77
  changes = changes.concat(result);
72
78
  count = RSYNC_RETRIES;
73
79
 
@@ -92,7 +98,7 @@ async function _syncFiles(executionType, cmdEnv, from, to, extraOptions = [], ar
92
98
  .filter(line => !/write error: Broken pipe/.test(line) && !fs.existsSync(to)) // quando não existe localmente dir base
93
99
  ;
94
100
  if(relevantErrors.length == 0){
95
- if (args.verbose > 2)
101
+ if (args.verbose > 1)
96
102
  console.log("rsync '" + product + "': success ");
97
103
  count = RSYNC_RETRIES;
98
104
  resolve();
@@ -1,4 +1,5 @@
1
1
  const chokidar = require('chokidar');
2
+ const path = require('path');
2
3
  const fs = require('fs-extra');
3
4
  const execa = require('execa');
4
5
  const git = require('simple-git');
@@ -63,7 +64,8 @@ async function otherFilesContiousReload(cmdEnv) {
63
64
  usePolling: true,
64
65
  ignoreInitial: true
65
66
  });
66
- watcher.process.on('all', async (eventType, changedFile) => {
67
+ watcher.process.on('all', async (eventType, changedFileNative) => {
68
+ let changedFile = changedFileNative.split(path.sep).join(path.posix.sep)
67
69
  // Não é preciso fazer nada para directorias que só existem no servidor
68
70
  let product = changedFile.split("/")[0];
69
71
  let productDir = resolveCobPath(cmdEnv.server, "serverLive", product).split(":")[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cob-cli",
3
- "version": "2.45.0",
3
+ "version": "2.46.0-beta.2",
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": {
@@ -9,8 +9,8 @@
9
9
  },
10
10
  "main": "./bin/cob-cli.js",
11
11
  "scripts": {
12
- "postinstall": "bin/cob-cli.js --setup",
13
- "uninstall": "bin/cob-cli.js --cleanup"
12
+ "postinstall": "./bin/cob-cli.js --setup",
13
+ "uninstall": "./bin/cob-cli.js --cleanup"
14
14
  },
15
15
  "bin": {
16
16
  "cob-cli": "bin/cob-cli.js"
package/tsconfig.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ compilerOptions": {
3
+ "module": "commonjs",
4
+ "target": "ESNext",
5
+ "checkJs": false
6
+ },
7
+ "exclude": [
8
+ "node_modules"
9
+ ]
10
+ }