-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTypeExtensionManager.js
More file actions
41 lines (36 loc) · 1.27 KB
/
TypeExtensionManager.js
File metadata and controls
41 lines (36 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
* Type Extension Manager
* Developer(s): Bhuvanesh(bhuvanesh.arasu@infor.com)
*/
import utils from './utils'
import CONSTANTS from './constants'
import { runConfig } from './utility/customerUtility';
let {initModules, writeUserData, getBasicKey, processCustomer} = utils
let {CMD_ARGUMENTS:{DOC_ARG, TYPE_ARG, HELP_ARG}, STARTUP_LOG, MESSAGES:{HELP:{HELP_TEXT}}} = CONSTANTS
const main = async () => {
if(process.argv.indexOf(HELP_ARG) != -1){
console.log(HELP_TEXT)
process.exit(0)
}
await initModules().then(async (essentials) => {
let configType = ``
let rulesetType = ``
if(!essentials.existing){
await writeUserData()
console.log(`Since this is the first time using the tool kindly restart the tool.`)
process.exit(0)
}
await getBasicKey(essentials)
if(process.argv.indexOf(DOC_ARG) != -1 && process.argv.indexOf(TYPE_ARG) != -1){
let indexOfConfigType = process.argv.indexOf(DOC_ARG) + 1
let indexOfType = process.argv.indexOf(TYPE_ARG) + 1
rulesetType = process.argv[indexOfType]
configType = process.argv[indexOfConfigType]
runConfig(essentials, configType, rulesetType)
}
await processCustomer(essentials)
process.exit()
})
}
console.log(STARTUP_LOG.STARTUP_SCREEN)
main()