Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async handle (argv: string[]) {
const { Kernel, handleError, Manifest, BaseCommand } = require('@adonisjs/ace')
const manifest = new Manifest(this._ignitor.application.appRoot)
const kernel = new Kernel()
kernel.useManifest(manifest)
/**
* Print help when no command is defined
*/
if (!argv.length) {
await kernel.handle() // This will load the commands from manifest
this._printHelp(kernel)
return
}
/**
* Generate manifest when command is `generate:manifest`
*/
if (argv[0] === 'generate:manifest') {
* file that was distributed with this source code.
*/
import { join } from 'path'
import { yellow, underline } from 'kleur'
import { Kernel, Manifest } from '@adonisjs/ace'
import { getCliVersion, getAdonisCoreVersion, dumpAsciiLogo } from './src/helpers'
const kernel = new Kernel()
/**
* Using manifest file over loading all commands all the
* time
*/
const manifest = new Manifest(join(__dirname))
kernel.useManifest(manifest)
/**
* Printing the help screen
*/
kernel.flag('help', (value, _options, command) => {
if (!value) {
return
}
dumpAsciiLogo()
kernel.printHelp(command)
process.exit(0)
}, {})
/**
/*
* @adonisjs/assembler
*
* (c) Harminder Virk
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { Manifest } from '@adonisjs/ace'
new Manifest(__dirname).generate([
'./commands/Build',
'./commands/Serve',
'./commands/Invoke',
'./commands/Make/Command',
'./commands/Make/Controller',
'./commands/Make/Middleware',
'./commands/Make/Provider',
'./commands/Make/View',
])
/*
* @adonisjs/cli
*
* (c) Harminder Virk
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { join } from 'path'
import { Manifest } from '@adonisjs/ace'
const manifest = new Manifest(join(__dirname))
manifest.generate(
[
'./src/Commands/Serve',
'./src/Commands/Build',
'./src/Commands/New',
'./src/Commands/DumpRcFile',
'./src/Commands/RunInstructions',
'./src/Commands/Make/Controller',
'./src/Commands/Make/Model',
'./src/Commands/Make/Provider',
'./src/Commands/Make/Middleware',
],
)