-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.js
45 lines (41 loc) · 1.08 KB
/
setup.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
const fs = require('fs')
const inquirer = require('inquirer')
const questions = [
{
type: 'input',
name: 'devbottoken',
message: 'Local development bot token: '
},
{
type: 'input',
name: 'testbottoken',
message: 'Test bot token (optional): '
},
{
type: 'input',
name: 'prodbottoken',
message: 'Prod bot token (optional): '
},
{
type: 'input',
name: 'testusername',
message: 'Test username (optional): '
},
{
type: 'input',
name: 'testhost',
message: 'Test hostname (optional): '
},
{
type: 'input',
name: 'sshkeypath',
message: 'Path to your ssh private key (optional): '
}
]
inquirer.prompt(questions).then(function (answers) {
answers.sshkeypath = answers.sshkeypath.replace(/['"]+/g, '')
answersJson = JSON.stringify(answers, null, 4)
console.log(answersJson)
fs.writeFileSync('secret.json', JSON.stringify(answers, null, 4))
console.log('Secrets have been saved to secret.json')
})