1 | const path = require('path');
|
2 |
|
3 | const { copyFiles, json, template } = require('mrm-core');
|
4 |
|
5 | module.exports = () => {
|
6 | const pkg = json('package.json');
|
7 |
|
8 | const staticTemplates = [
|
9 | '.github/ISSUE_TEMPLATE/DOCS.md',
|
10 | '.github/ISSUE_TEMPLATE/SUPPORT.md',
|
11 | ];
|
12 |
|
13 | const dynamicTemplates = [
|
14 | 'ISSUE_TEMPLATE.md',
|
15 | 'ISSUE_TEMPLATE/BUG.md',
|
16 | 'ISSUE_TEMPLATE/FEATURE.md',
|
17 | 'ISSUE_TEMPLATE/MODIFICATION.md',
|
18 | ];
|
19 |
|
20 | const sourceDir = path.join(__dirname, '../../templates');
|
21 |
|
22 | copyFiles(sourceDir, staticTemplates);
|
23 |
|
24 | for (const tmpl of dynamicTemplates) {
|
25 | const file = template(
|
26 | `.github/${tmpl}`,
|
27 | path.join(__dirname, `../../templates/.github/${tmpl}`)
|
28 | );
|
29 |
|
30 | file.apply({ package: pkg.get('name') }).save();
|
31 | }
|
32 | };
|