yo icon indicating copy to clipboard operation
yo copied to clipboard

Option alias to short, bad error

Open Natejoestev opened this issue 11 months ago • 0 comments

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.

Natejoestev avatar Jul 08 '23 20:07 Natejoestev