cob-cli 2.4.2 → 2.5.1

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.
@@ -26,6 +26,7 @@ async function deploy(args) {
26
26
 
27
27
  if(changes.length == 0) {
28
28
  if(!args.force) {
29
+ await cmdEnv.unApplyCurrentCommandEnvironmentChanges()
29
30
  throw new Error("Canceled:".yellow + " nothing todo\n")
30
31
  }
31
32
  console.log(" Just updating deploy information.")
@@ -68,14 +68,16 @@ async function _applySpecific(environmentName) {
68
68
 
69
69
  for( let envSpecificFile of envSpecificFiles ) {
70
70
  let prodFile = envSpecificFile.replace(/\.ENV__.*__/,"")
71
- if(fs.existsSync(prodFile)) {
72
- let backupFile = envSpecificFile.replace(/\.ENV__.*__/,".ENV__ORIGINAL_BACKUP__")
73
- await git().raw(["update-index","--assume-unchanged", prodFile])
74
- fs.renameSync(prodFile, backupFile)
75
- } else {
76
- let deleteFile = envSpecificFile.replace(/\.ENV__.*__/,".ENV__DELETE__")
77
- fs.appendFileSync('.git/info/exclude', "\n" + prodFile)
78
- fs.closeSync(fs.openSync(deleteFile, 'w'));
71
+ let deleteFile = envSpecificFile.replace(/\.ENV__.*__/,".ENV__DELETE__")
72
+ if(!fs.existsSync(deleteFile)) {
73
+ if(fs.existsSync(prodFile)) {
74
+ let backupFile = envSpecificFile.replace(/\.ENV__.*__/,".ENV__ORIGINAL_BACKUP__")
75
+ await git().raw(["update-index","--assume-unchanged", prodFile])
76
+ fs.renameSync(prodFile, backupFile)
77
+ } else {
78
+ fs.appendFileSync('.git/info/exclude', "\n" + prodFile)
79
+ fs.closeSync(fs.openSync(deleteFile, 'w'));
80
+ }
79
81
  }
80
82
  fs.renameSync(envSpecificFile, prodFile)
81
83
  await git().raw(["update-index","--assume-unchanged", envSpecificFile])
@@ -64,7 +64,7 @@ async function otherFilesContiousReload(cmdEnv) {
64
64
  let productDir = resolveCobPath(cmdEnv.server, "serverLive", product).split(":")[1];
65
65
  let productScopeFilePath = changedFile.substring(changedFile.indexOf("/") + 1); // remove o directorio inicial do producto
66
66
 
67
- let isRemoteFile = await execa('ssh', [cmdEnv.server, "[[ -f " + productDir + productScopeFilePath + " ]] && echo 'file' || echo '' " ])
67
+ let isRemoteFile = () => execa('ssh', [cmdEnv.server, "[[ -f " + productDir + productScopeFilePath + " ]] && echo 'file' || echo '' " ])
68
68
  .then( r => {
69
69
  return r.stdout == "file"
70
70
  }).catch( () => {
@@ -77,14 +77,15 @@ async function otherFilesContiousReload(cmdEnv) {
77
77
  } catch {}
78
78
 
79
79
  if (
80
- (isLocalFile || isRemoteFile)
81
- && changedFile.indexOf("/customUI/") < 0
80
+ changedFile.indexOf("/customUI/") < 0
81
+ && changedFile.indexOf("/node_modules/") < 0
82
82
  && !changedFile.startsWith(".git")
83
83
  && !changedFile.startsWith(".idea")
84
84
  && !changedFile.startsWith(".DS_Store")
85
85
  && !changedFile.endsWith(".swp")
86
86
  && !changedFile.endsWith(".swap")
87
87
  && changedFile.indexOf(IN_PROGRESS_TEST_FILE) < 0
88
+ && (isLocalFile || await isRemoteFile())
88
89
  ) {
89
90
  try {
90
91
  await addFileToCurrentTest(cmdEnv.server, changedFile, changedFiles, " Syncing ".bgRed.bold + " ", restoreChanges );
@@ -40,6 +40,10 @@ module.exports = env => {
40
40
  target: "http://localhost:8041",
41
41
  secure: false
42
42
  },
43
+ [ "/docs/**"]: {
44
+ target: "http://localhost:8080",
45
+ secure: false
46
+ },
43
47
  "/": {
44
48
  logLevel: "warn",
45
49
  target: env.SERVER,
@@ -58,7 +62,7 @@ module.exports = env => {
58
62
  return localPath;
59
63
  },
60
64
  onProxyRes: response => {
61
- response.headers['content-security-policy'] = "default-src 'unsafe-inline' 'unsafe-eval' https: data: http:";
65
+ response.headers['content-security-policy'] = "default-src 'unsafe-inline' 'unsafe-eval' https: data: http: ws:";
62
66
  }
63
67
  }
64
68
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cob-cli",
3
- "version": "2.4.2",
3
+ "version": "2.5.1",
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": {