1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | const { template } = require('mrm-core')
|
11 | const { join } = require('path')
|
12 |
|
13 | const gh = require('../utils/ghAttributes')
|
14 | const mergeConfig = require('../utils/mergeConfig')
|
15 | const core = require('./core')
|
16 | const standard = require('./standard')
|
17 |
|
18 | const prTemplate = '.github/PULL_REQUEST_TEMPLATE.md'
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | function task (config) {
|
30 | const ghAttributes = gh('creating github templates')
|
31 | mergeConfig(config, { repo: ghAttributes.repo })
|
32 |
|
33 | if (config.core) {
|
34 | core.up()
|
35 | standard.down()
|
36 | } else {
|
37 | standard.up()
|
38 | core.down()
|
39 | }
|
40 |
|
41 | template(prTemplate, join(__dirname, 'templates', 'pr.md')).apply(ghAttributes).save()
|
42 | }
|
43 |
|
44 | task.description = 'Adds Github related templates'
|
45 | module.exports = task
|