-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapp.js
executable file
·33 lines (32 loc) · 973 Bytes
/
app.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
#! /usr/bin/env node
const inquirer = require('inquirer')
// Helpers
const utils = require('./utils.js')
const helpers = require('./helpers.js')
// helper pointers
const questions = utils.questions
inquirer.prompt(questions).then(answers => {
let username = answers.username;
let domain = answers.domain;
if (answers.domain == 'custom_domain') {
inquirer.prompt({
type: 'input',
name: 'domain_name',
message: 'Enter the Custom Domain Name :',
validate: helpers.validateUrl
}).then(ans => {
if (answers.isConfirm) {
helpers.generateKeys(answers.username, ans.domain_name, 'generate');
} else {
helpers.generateKeys(answers.username, ans.domain_name, 'print');
}
})
}
if (answers.domain != 'custom_domain') {
if (answers.isConfirm) {
helpers.generateKeys(answers.username, domain, 'generate');
} else {
helpers.generateKeys(answers.username, domain, 'print');
}
}
});