1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | const { template, deleteFiles } = require('mrm-core')
|
11 | const { join } = require('path')
|
12 | const debug = require('debug')('adonis:mrm-github')
|
13 |
|
14 | class CoreTemplates {
|
15 | constructor () {
|
16 | this.issues = '.github/ISSUE_TEMPLATE/bug_report.md'
|
17 | this.features = '.github/ISSUE_TEMPLATE/feature_request.md'
|
18 | }
|
19 |
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | up () {
|
28 | debug('using templates: %o', [this.issues, this.features])
|
29 |
|
30 | template(this.issues, join(__dirname, 'templates', 'bugs.md')).apply().save()
|
31 | template(this.features, join(__dirname, 'templates', 'features.md')).apply().save()
|
32 | }
|
33 |
|
34 | |
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | down () {
|
42 | debug('removing templates: %o', [this.issues, this.features])
|
43 |
|
44 | deleteFiles([this.issues, this.features])
|
45 | }
|
46 | }
|
47 |
|
48 | module.exports = new CoreTemplates()
|