-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
36 lines (30 loc) · 899 Bytes
/
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
#!/usr/bin/env node
"use strict";
const logger = require("./lib/logger");
const jira = require("./lib/jira");
const formatter = require("./lib/formatter");
const print = require("./lib/print");
const options = require("./lib/options");
logger.isVerbose = options.verbose;
process.on("uncaughtException", logger.error);
const client = jira.connect({
username: options.username,
password: options.password,
host: options.host
});
const versionName = options.filterVersion;
client
.getReleasedIssues({ versionName })
.then(issues => {
const { format } = formatter(options.format);
logger.onlyTTY.info("STARTING OUTPUT <<<\n");
print(format({ versionName, issues }));
logger.onlyTTY.info(">>> ENDING OUTPUT\n");
})
.catch(e => {
if (!e.response || !e.statusCode) {
logger.error(e);
return;
}
logger.error(e.statusCode, e.response.body);
});