-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathindex.js
35 lines (26 loc) · 1.05 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
const { Command } = require('commander');
const program = new Command();
program.version('0.1.0');
const build = require('./tools/build');
const defaultSource = __dirname + '/apis-list.yaml';
const defaultDestination = __dirname;
program
.command('build [source] [destination]')
.description('build apis files from database')
.action((source, destination) => build(source || defaultSource, destination || defaultDestination));
program
.command('check-links [source]')
.action(async (source) => await require('./tools/check-links')(source || defaultSource));
program
.command('check-orphans [source]')
.action((source) => require('./tools/check-orphans')(source || defaultSource));
program
.command('lib [source]')
.action(async source => await require('./tools/lib')(source || defaultSource));
program
.command('add [source]')
.action(async source => await require('./tools/add')(source || defaultSource));
program.parseAsync(process.argv)
.then(() => {
console.log("Goodbye!");
}).catch(console.error)