-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathindex.js
executable file
·49 lines (36 loc) · 1.22 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
48
49
'use strict';
const Vorpal = require('vorpal');
const vorpal = new Vorpal();
const less = require('vorpal-less');
const grep = require('vorpal-grep');
const app = {
vorpal,
init(options) {
options = options || {};
const dir = `${__dirname}/.`;
this.clerk = require('./clerk/clerk')(app);
this.spider = require('./spider/spider')(app);
this.autodocs = require('./autodocs/autodocs')(app);
this.cosmetician = require('./cosmetician/cosmetician')(app);
const modules = ['sigint', 'theme', 'indexer', 'updater', 'spider', 'catch', 'autodocs', 'hist', 'tour', 'proxy'];
for (let i = 0; i < modules.length; ++i) {
vorpal.use(`${dir}/vorpal/${modules[i]}.js`, {app});
}
vorpal
.use(less)
.use(grep)
.delimiter('?')
.show();
if (process.argv.indexOf('dev') > -1) {
options.updateRemotely = false;
process.argv.splice(2, process.argv.length);
vorpal.log('\n You\'re now in document development mode.\n You will be able to see your local document changes.\n');
}
this.updateRemotely = options.updateRemotely;
this.clerk.start(options);
if (process.argv.length > 2) {
vorpal.parse(process.argv);
}
}
};
module.exports = app;