@adonisjs/cli
Version:
Command line tool for Adonisjs
65 lines (58 loc) • 1.1 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 provider
*
* @class MakeProvider
* @constructor
*/
class MakeProvider extends BaseCommand {
/**
* The command signature
*
* @method signature
*
* @return {String}
*/
static get signature () {
return `
make:provider
{ name: Name of the provider }
`
}
/**
* The command description
*
* @method description
*
* @return {String}
*/
static get description () {
return 'Make a new provider'
}
/**
* Handle method executed by ace
*
* @method handle
*
* @param {String} options.name
* @param {String} options.type
*
* @return {void}
*/
async handle ({ name }) {
await this.invoke(async () => {
await this.ensureInProjectRoot()
await this.generateBlueprint('provider', name, {})
})
}
}
module.exports = MakeProvider