-
Notifications
You must be signed in to change notification settings - Fork 0
/
assistant.js
48 lines (40 loc) · 1.48 KB
/
assistant.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
48
'use strict';
const chalk = require('chalk');
const inquirer = require('inquirer');
const config = require('./config');
const Box = require("cli-box");
const Assistant = {
start: () => {
var b1 = Box("70x3", chalk.gray("Death notes for broken links in your documentation files"));
console.log("\n 📓 " + chalk.bold.underline("Lawliet") + " 📓\n" + b1.toString() + "\n");
var questions = [
{
type: 'input',
name: 'path',
message: 'Enter path for recursive search - default:',
default: __dirname
},
{
type: 'input',
name: 'extension',
message: 'Regex extension pattern for files to search in - default:',
default: config.extensionFiles
}
];
if (config.hosts) {
config.hosts.forEach(hostConfig => {
hostConfig.cookies.map((cookieKey) => {
const cookiePrompt = {
type: 'input',
name: config.cookiePrefix + cookieKey,
message: 'Enter value for cookie named ' + cookieKey + ':',
default: ""
};
questions.push(cookiePrompt);
})
});
}
return inquirer.prompt(questions);
}
}
module.exports = Assistant;