-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
executable file
·47 lines (39 loc) · 1.18 KB
/
index.js
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
42
43
44
45
46
47
#!/usr/bin/env node
const program = require('commander')
const { prompt } = require('inquirer')
// Require logic.js file and extract controller functions using JS destructuring assignment
const { createInitFile, createInitEnvFile } = require('./logic')
const { initQuestions, initEnvQuestions } = require('./questions')
const { encryptWithCheckJet, checkJetCLI } = require('./util.js')
program
.version('0.0.1')
.description('CLI for deployment with Codeship pro. by Sellsuki Team')
program
.command('init')
.alias('i')
.description('Create initial files for deployment by Codeship pro.')
.action(() => {
prompt(initQuestions).then(answers =>
createInitFile(answers))
})
program
.command('init-env')
.alias('ie')
.description('Create initial files and environment for deployment by Codeship pro.')
.action(() => {
prompt(initEnvQuestions).then(answers =>
createInitEnvFile(answers))
})
program
.command('check-jet')
.description('Check installation of jet-cli')
.action(() => {
checkJetCLI()
})
program
.command('encrypt')
.description('Encrypt with default file [`codeship.aes` and `env`]')
.action(() => {
encryptWithCheckJet()
})
program.parse(process.argv)