-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
57 lines (41 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
50
51
52
53
54
55
56
57
const chalk = require('chalk');
const config = require('./src/config.js');
const githubInfo = require('./lib/git/github-info.js');
const program = require('./src/program.js');
const questions = require('./src/questions.js');
const settings = require('./src/settings.js');
const createBranch = require('./src/create-branch.js');
const createChangelog = require('./src/create-changelog.js');
const createPullRequest = require('./src/create-pullrequest.js');
const createLabels = require('./src/create-labels.js');
const deleteLabels = require('./src/delete-labels.js');
(async () => {
try {
const answers = await questions(githubInfo, program);
const results = Object.assign({}, config.store, settings, githubInfo, answers);
switch (results.task) {
case 'branch':
await createBranch(results);
break;
case 'pr':
await createPullRequest(results);
break;
case 'changelog':
await createChangelog(results);
break;
case 'gh-remove-default-labels':
await deleteLabels(results);
break;
case 'gh-sync-custom-labels':
await createLabels(results);
break;
case 'reset-config':
config.clear();
break;
default:
break;
}
} catch (err) {
console.error(err);
}
})();