forked from ct-js/ct-js-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
comigojiChangelog.js
80 lines (77 loc) · 2.65 KB
/
comigojiChangelog.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// $ comigoji-changelog ./comigojiChangelog.js > Changelog.md
const gitCommand = 'git log --max-count=1 --tags --simplify-by-decoration --pretty="format:%cI"';
const {exec} = require('child_process');
const miscEmojis = [
'😱', '🙀', '👻', '🤖', '👾', '👽', '😜', '👀', '✌️', '🦄', '🐉', '🌝', '🌚', '🌻', '☄️', '🎲', '🎁', '😺'
];
module.exports = new Promise((resolve, reject) => {
exec(gitCommand, function (err, stdout, stderr) {
if (err) {
reject(err);
return;
}
if (stderr) {
reject(new Error(stderr));
return;
}
const since = new Date(stdout.trim());
resolve({
repos: [{
since,
repo: './',
branch: 'develop'
}, {
since,
repo: './../ctjsDocs',
branch: 'master',
forceCategory: 'docs',
forceCategoryStrip: /^:(books|pencil|pencil2|memo):/
}, {
since,
repo: './../ctjsSite',
branch: 'master',
forceCategory: 'website'
}],
categories: {
rollback: {
pattern: /^:(roller_coaster|rewind):/,
header: '### 🎢 Rollbacked'
},
feature: {
pattern: /^:(rainbow|sparkles):/,
header: '### ✨ New Features'
},
improvement: {
pattern: /^:(zap|wrench):/,
header: '### ⚡️ General Improvements'
},
bug: {
pattern: /^:bug:/,
header: '### 🐛 Bug Fixes'
},
assets: {
pattern: /^:(briefcase|bento):/,
header: '### 🍱 Demos, Dependencies and Stuff'
},
docs: {
pattern: /^:(books|pencil|pencil2|memo):/,
header: '### 📝 Docs'
},
website: {
header: '### 🌐 Website'
},
default: {
header: `### ${miscEmojis[Math.floor(Math.random() * miscEmojis.length)]} Misc`
},
ignore: {
pattern: /^:(construction|doughnut|rocket|bookmark):/,
skip: true
},
merges: {
pattern: 'Merge pull request #',
skip: true
}
}
});
});
});