cob-cli 2.53.0-beta-2 → 2.53.0
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/bin/handleAutoComplete.js +19 -4
- package/lib/commands/deploy.js +2 -1
- package/lib/commands/test.js +1 -0
- package/package.json +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
+
const fs = require('fs');
|
|
2
3
|
|
|
3
4
|
/* Autocomplete Component*/
|
|
4
5
|
var omelette = require('omelette');
|
|
5
6
|
const commandStructure = {
|
|
6
|
-
'init' : [],
|
|
7
|
-
'customize' : [],
|
|
8
|
-
'test' : [],
|
|
9
|
-
'deploy' : [],
|
|
7
|
+
'init' : [],
|
|
8
|
+
'customize' : [],
|
|
9
|
+
'test' : [],
|
|
10
|
+
'deploy' : [],
|
|
10
11
|
'updateFromServer' : [],
|
|
11
12
|
'upgradeRepo' : []
|
|
12
13
|
}
|
|
@@ -19,9 +20,23 @@ if (~process.argv.indexOf('--setup')) {
|
|
|
19
20
|
// we exit cleanly so that postinstall completes successfuly
|
|
20
21
|
process.exit(0)
|
|
21
22
|
}
|
|
23
|
+
if (isAutocompleteAlreadyInstalled()) {
|
|
24
|
+
console.log("Autocomplete already set up, skipping.")
|
|
25
|
+
process.exit(0)
|
|
26
|
+
}
|
|
22
27
|
console.log("Setting up...")
|
|
23
28
|
completion.setupShellInitFile()
|
|
24
29
|
}
|
|
30
|
+
|
|
31
|
+
function isAutocompleteAlreadyInstalled() {
|
|
32
|
+
try {
|
|
33
|
+
const initFile = completion.getDefaultShellInitFile()
|
|
34
|
+
if (!initFile || !fs.existsSync(initFile)) return false
|
|
35
|
+
return fs.readFileSync(initFile, 'utf8').includes('# begin cob-cli completion')
|
|
36
|
+
} catch (e) {
|
|
37
|
+
return false
|
|
38
|
+
}
|
|
39
|
+
}
|
|
25
40
|
// remove from system profiles
|
|
26
41
|
if (~process.argv.indexOf('--cleanup')) {
|
|
27
42
|
if (process.platform === 'win32') {
|
package/lib/commands/deploy.js
CHANGED
|
@@ -37,7 +37,8 @@ async function deploy(args) {
|
|
|
37
37
|
if(!args.force) {
|
|
38
38
|
await cmdEnv.unApplyCurrentCommandEnvironmentChanges()
|
|
39
39
|
clearOperationState()
|
|
40
|
-
|
|
40
|
+
console.log("\nCanceled!".yellow + " nothing todo\n")
|
|
41
|
+
return
|
|
41
42
|
}
|
|
42
43
|
console.log(" Just updating deploy information.")
|
|
43
44
|
}
|
package/lib/commands/test.js
CHANGED
package/package.json
CHANGED