jondot / hygen

The simple, fast, and scalable code generator that lives in your project.

Home Page:http://www.hygen.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow to change the default `_templates` directory on `hygen init`

lktslionel opened this issue · comments

I want to be able to change the default template directory name _templates by whatever I want.
I like to use dotted directory (Eg: .templates) for things not directly related to the core of my project. So, I will be great if could set the parameter --tmpls-dir when initializing the hygen inot my project.

So, intializing the hygen with a custom templates dir will be done as follows:

hygen init self --tmpls-dir .templates

The command below will:

  1. Initialize all templates inside .templatesdirectory instead of the default _templates dir.
  2. Create a .hygen.js file settings the new templates dir as default for templated discovery with contents:
module.exports = {
  templates: `${__dirname}/.templates`
}

Let me know if it make sens, so that I can contribute.

I'm new to the project, that's why any guidance on the parts of the code to change, will be helpful.
It looks like it is the setup ops that is doing the init.

Thanks

This is a great idea
I would be happy to accept a PR for it

any update on this one ? :)