UNPKG

904 BJavaScriptView 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-github')
13
14class StandardTemplate {
15 constructor () {
16 this.issues = '.github/ISSUE_TEMPLATE.md'
17 }
18
19 /**
20 * Create required templates
21 *
22 * @method up
23 *
24 * @return {void}
25 */
26 up () {
27 debug('using template: %s', this.issues)
28 template(this.issues, join(__dirname, 'templates', 'issues.md')).apply().save()
29 }
30
31 /**
32 * Remove previously created template
33 *
34 * @method down
35 *
36 * @return {void}
37 */
38 down () {
39 debug('removing template: %s', this.issues)
40 deleteFiles(this.issues)
41 }
42}
43
44module.exports = new StandardTemplate()