-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command discovery does not working in directories that contain files other than javascript #197
Comments
@mattallty 👋, Any thoughts on this? |
Related issue here. I have a Typescript project where the The commands work, but the global help show each command two times instead of one. |
New to this lib, but looking at the source in scan I think I see the issue: https://github.com/mattallty/Caporal.js/blob/master/src/command/scan.ts#L19 This needs to be scoped to include only files that contain commands, thinking more on this it can't just be JS, is there some convention that could be used? {name}.command.js? |
Describe the bug
program.discover does not work with typescript compilation outputs.
To Reproduce
Steps to reproduce the behavior:
1- Create a typescript project
2- Create a program
3- Create a directory called commands
4- Put a command into the commands directory
5- Enable command discovery via the
discover
option.6- Compile the project
Expected behavior
Command discovery should not try to require non-javascript files such as typescript declaration files.
Actual behavior
Command discovery is trying to require types such as typescript declarations.
Environment informations (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: