Skip to content

Commit

Permalink
Merge pull request #127 from AthennaIO/develop
Browse files Browse the repository at this point in the history
fix(kernel): register all commands when not registered using rc
  • Loading branch information
jlenon7 authored Mar 28, 2023
2 parents 051b6f0 + 42bbca8 commit 8a4e29b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/artisan",
"version": "3.7.0",
"version": "3.7.1",
"description": "The Athenna CLI application. Built on top of commander and inspired in @adonisjs/ace.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
8 changes: 7 additions & 1 deletion src/Kernels/ConsoleKernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@ export class ConsoleKernel {
/**
* If the command is not inside "rc.commands", then it
* means that is registered using route file or does not exist.
*
* Commander does not throw errors when a command does not exist
* and there are any command registered in the application. To
* avoid this behavior we are going to register all commands of
* "rc.commands" when the command is using route file or does not
* exist.
*/
if (!command) {
return
return this.registerAllCommands()
}

const path = command.path || command
Expand Down

0 comments on commit 8a4e29b

Please sign in to comment.