@adonisjs/cli
Version:
Command line tool for Adonisjs
66 lines (59 loc) • 1.15 kB
JavaScript
/*
* adonis-cli
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
const BaseCommand = require('./Base')
/**
* Make a new edge view
*
* @class MakeView
* @constructor
*/
class MakeView extends BaseCommand {
/**
* The command signature
*
* @method signature
*
* @return {String}
*/
static get signature () {
return `
make:view
{ name: Name of the view }
{ -l, --layout=@value: Define a layout to extend }
`
}
/**
* The command description
*
* @method description
*
* @return {String}
*/
static get description () {
return 'Make a view file'
}
/**
* Handle method executed by ace
*
* @method handle
*
* @param {String} options.name
* @param {String} options.type
*
* @return {void}
*/
async handle ({ name }, { layout }) {
await this.invoke(async () => {
await this.ensureInProjectRoot()
await this.generateBlueprint('view', name, { layout })
})
}
}
module.exports = MakeView