Skip to content

Commit 9d5b9c9

Browse files
committed
WIP
1 parent 42d432e commit 9d5b9c9

File tree

5 files changed

+68
-7
lines changed

5 files changed

+68
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "git-token",
3-
"version": "0.0.27",
3+
"version": "0.0.28",
44
"description": "GitToken CLI Program",
55
"bin": {
66
"git-token": "./src/index.js",

src/deploy/index.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ let variables = {}
99

1010
inquirer.prompt(options['services']).then((answer) => {
1111
return nextService(answer.service, {})
12-
}).then((answer) => {
13-
console.log('answer', answer)
12+
}).then(() => {
13+
console.log('variables', variables)
1414
}).catch((error) => {
1515
console.log(error)
1616
})
@@ -22,9 +22,20 @@ function nextService(serviceList, envs) {
2222
if (serviceList.length == 0 || !options[s]) {
2323
resolve(null)
2424
}
25-
inquirer.prompt(options[s](envs)).then((answer) => {
25+
26+
if (s) {
27+
console.log(`
28+
Inquiring about service: ${s}
29+
`)
30+
}
31+
32+
const prompt = inquirer.createPromptModule()
33+
34+
prompt(options[s](envs)).then((answer) => {
2635
variables = Object.assign(variables, answer)
27-
resolve(nextService(serviceList, variables))
36+
return nextService(serviceList, variables)
37+
}).then(() => {
38+
resolve(true)
2839
}).catch((error) => {
2940
reject(error)
3041
})

src/deploy/mysql-options.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
const Promise = require('bluebird')
2+
const defaultFilter = require('../utils/filter')
3+
4+
const mysqlHost = ({ option }) => {
5+
return {
6+
type: 'input',
7+
name: 'mysqlHost',
8+
message: 'Please enter mysql IPv4 host address: ',
9+
default: option ? option : '127.0.0.1:3306',
10+
filter: defaultFilter
11+
}
12+
}
13+
14+
const mysqlUser = ({ option }) => {
15+
return {
16+
type: 'input',
17+
name: 'mysqlUser',
18+
message: 'Please enter mysql user name: ',
19+
default: option ? option : 'root',
20+
filter: defaultFilter
21+
}
22+
}
23+
24+
const mysqlRootPassword = ({ option }) => {
25+
return {
26+
type: 'password',
27+
name: 'mysqlRootPassword',
28+
message: 'Please enter mysql user password: ',
29+
default: option ? option : null,
30+
filter: defaultFilter
31+
}
32+
}
33+
34+
const mysqlDatabase = ({ option }) => {
35+
return {
36+
type: 'input',
37+
name: 'mysqlDatabase',
38+
message: 'Please enter mysql database name: ',
39+
default: option ? option : 'git_token',
40+
filter: defaultFilter
41+
}
42+
}
43+
44+
module.exports = (options) => {
45+
return [
46+
mysqlHost({ option: options['mysqlHost'] }),
47+
mysqlUser({ option: options['mysqlUser'] }),
48+
mysqlRootPassword({ option: options['mysqlRootPassword'] }),
49+
mysqlDatabase({ option: options['mysqlDatabase'] })
50+
]
51+
}

src/deploy/signer-options.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ const recover = ({ option }) => {
8282
}
8383

8484
module.exports = (options) => {
85-
console.log('options', options)
8685
return [
8786
signerIpcPath({ option: options['signerIpcPath'] }),
8887
dirPath({ option: options['dirPath'] }),

src/deploy/webhook-options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const signerIpcPath = ({ option }) => {
2525
return {
2626
type: 'input',
2727
name: 'signerIpcPath',
28-
message: 'Please enter path for GitToken signer IPC socket:',
28+
message: 'Please enter an ipc socket path for the signer:',
2929
default: option ? option : '/tmp/signer.sock',
3030
filter: defaultFilter
3131
}

0 commit comments

Comments
 (0)