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-probot')
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | class StaleTemplate {
|
18 | constructor () {
|
19 | this.template = '.github/stale.yml'
|
20 | this.message = 'Make sure to also install https://probot.github.io/apps/stale app.'
|
21 | }
|
22 |
|
23 | |
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | up () {
|
31 | debug('using template: %s', this.template)
|
32 | template(this.template, join(__dirname, 'templates', 'stale.yml')).apply().save()
|
33 | }
|
34 |
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | down () {
|
43 | debug('removing template: %s', this.template)
|
44 | deleteFiles([this.template])
|
45 | }
|
46 | }
|
47 |
|
48 | module.exports = new StaleTemplate()
|