onedesign / generator-one-base

A foundation for One Design Company projects on the web.
Other
1 stars 1 forks source link

Run generators inside of a directory unless parent directory matches project name. #142

Closed cmalven closed 6 years ago

cmalven commented 6 years ago

Outputs the contents of the static, craft2, and craft3 generators in a new directory matching the projectName unless the directory the generator is run in matches the projectName.

It could be argued that the other generators should also follow this logic for consistency, but since the other generators are much more likely to only be run on their own inside of existing projects, I think its fair to start here.

The one piece not implemented here that should probably be handled separately is the ability to pass in the projectName via a command line argument when running the generator, e.g. yo one-base:craft3 my-craft-project.

Getting this argument working was fairly easy, using the value of the argument as a default value for the projectName prompt was not as obvious.