-
Notifications
You must be signed in to change notification settings - Fork 127
/
fun-nas-info.js
executable file
·49 lines (38 loc) · 1.07 KB
/
fun-nas-info.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
#!/usr/bin/env node
/* eslint-disable quotes */
'use strict';
const program = require('commander');
const getVisitor = require('../lib/visitor').getVisitor;
const notifier = require('../lib/update-notifier');
program
.name('fun nas info')
.description('Print nas config information, such as local temp directory of NAS.')
.option('-t, --template [template]', 'The path of fun template file.')
.parse(process.argv);
if (program.args.length) {
console.error();
console.error(" error: unexpected argument '%s'", program.args[0]);
program.help();
}
notifier.notify();
getVisitor(true).then((visitor) => {
visitor.pageview('/fun/nas/info').send();
require('../lib/commands/nas/info')(program.template)
.then(() => {
visitor.event({
ec: 'info',
ea: 'info',
el: 'success',
dp: '/fun/nas/info'
}).send();
})
.catch(error => {
visitor.event({
ec: 'info',
ea: 'info',
el: 'error',
dp: '/fun/nas/info'
}).send();
require('../lib/exception-handler')(error);
});
});