UNPKG

1.03 kBJavaScriptView Raw
1/*
2* @adonisjs/mrm-preset
3*
4* (c) Harminder Virk <virk@adonisjs.com>
5*
6* For the full copyright and license information, please view the LICENSE
7* file that was distributed with this source code.
8*/
9
10const { template, deleteFiles } = require('mrm-core')
11const { join } = require('path')
12const debug = require('debug')('adonis:mrm-probot')
13
14/**
15 * Creates the `.github/lock.yml` file
16 */
17class LockTemplate {
18 constructor () {
19 this.template = '.github/lock.yml'
20 this.message = 'Make sure to also install https://probot.github.io/apps/lock app.'
21 }
22
23 /**
24 * Create required templates
25 *
26 * @method up
27 *
28 * @return {void}
29 */
30 up () {
31 debug('using template: %s', this.template)
32 template(this.template, join(__dirname, 'templates', 'lock.yml')).apply().save()
33 }
34
35 /**
36 * Remove previously created templates
37 *
38 * @method down
39 *
40 * @return {void}
41 */
42 down () {
43 debug('removing template: %s', this.template)
44 deleteFiles([this.template])
45 }
46}
47
48module.exports = new LockTemplate()