Skip to content
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

Option alias to short, bad error #791

Open
Natejoestev opened this issue Jul 8, 2023 · 0 comments
Open

Option alias to short, bad error #791

Natejoestev opened this issue Jul 8, 2023 · 0 comments

Comments

@Natejoestev
Copy link

Type of issue

Bug


My environment

OS: Windows 11 64 bit
Node: v18.1.0
Npm: 8.8.0
Yo: 4.3.1

Expected behavior

throw error like this:

Error (MY_GENERATOR)

Option (NAME) alias is to long.

NAME would be the first argument passed to the option function.

Current behavior

throws random error where this is undefined when calling a custom function on the generator.

Steps to reproduce the behavior

call option definition function with alias that is longer than 4 ish characters.

Command line output

Error (MY_GENERATOR) -myAlias option

Cannot read properties of undefined (reading 'usesPkgManager')

usesPkgManager is a function i defined on the custom generator to return a boolean whether it uses a packages manager.

note

it would be nice to document that the alias is required to be less than a certain length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant