dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
25 stars 34 forks source link

When discovering installed commands, do not scope when ran from another command #304

Closed matt-gadd closed 4 years ago

matt-gadd commented 4 years ago

Type: bug

The following has been addressed in the PR:

Description: In a number of performance related PR's (like https://github.com/dojo/cli/pull/283), we stopped loading all the installed commands if a group was provided to the cli. For example:

dojo create ____

The above would only glob for paths with cli-create and only load those too.

This is fine for normal interactive use of the cli to run commands, but commands such as cli-create-app can use the command helper to programmatically call another command. In this case that was dojo init. Because of the above, the determined group was still create (because passed in the terminal by the user), which meant that dojo init would only find commands by that name.

The code in cli is pretty convoluted, so the easiest way for me to fix this was to lift the argv bit out of enumerateInstalledCommands, and take the group in specifically. Not pretty, but it will do.

Resolves https://github.com/dojo/cli/issues/299 Resolves https://github.com/dojo/cli/issues/305