When using hygen as a standalone script in conjunction with yarn create something, npm create something, etc hygen fails to read custom templates passed in the config param.
The reason is because config.templates is applied only if the first condition is falsy, which is not the case using global yarn create, etc. In this case path.join(cwd, '_templates')] is always resolved to the default hygen _templates and actions (generator help, generator new, generator with-prompt).
When using
hygen
as a standalone script in conjunction withyarn create something
,npm create something
, etchygen
fails to read custom templates passed in theconfig
param.The reason is because
config.templates
is applied only if the first condition is falsy, which is not the case using globalyarn create
, etc. In this casepath.join(cwd, '_templates')]
is always resolved to the defaulthygen
_templates and actions (generator help, generator new, generator with-prompt).I think it would make more sense to first apply
config.templates
if they are explicitly passed: