Elixir project templates generation.
Latest
> mix archive.install github viniciuslcpereira97/template-generator
Specific branch
> mix archive.install github viniciuslcpereira97/template-generator branch $BRANCH
Specific version
> mix archive.install github viniciuslcpereira97/template-generator tag $RELEASE_TAG
> mix archive.install hex template_generator
.
└── example
├── schemas
│ └── example.ex
└── services
├── example.ex
└── user
└── user.ex
Set your templates directory's path in your config.exs
.
config :generator,
templates_dir: "./templates",
templates: [
my_awesome_template: "example"
]
templates_dir
: Directory with all available templates
templates
: the key is an alias for your template and the value is the template folder name found at your templates_dir
To create a new project based on an template you should run the following command:
> mix generator.new ./apps/my-awesome-new-folder --template=my_awesome_template
.
├── generator.ex
├── mix
│ └── tasks
│ └── generator.new.ex
├── path
│ ├── adapters
│ │ ├── git_resolver.ex
│ │ ├── json_resolver.ex
│ │ ├── local_resolver.ex
│ │ ├── path_creator.ex
│ │ ├── path_resolver.ex
│ │ ├── template_directory.ex
│ │ └── template_file.ex
│ ├── logic
│ └── schemas
│ ├── template_directory.ex
│ └── template_file.ex
├── paths.ex
├── project
│ ├── adapters
│ │ └── project.ex
│ ├── logic
│ └── schemas
│ └── project.ex
├── projects.ex
├── template
│ ├── adapters
│ │ └── template.ex
│ ├── logic
│ └── schemas
│ └── template.ex
└── templates.ex
.
├── generator.ex
├── mix
│ └── tasks
│ └── generator.new.ex
├── my-awesome-new-folder
│ ├── schemas
│ │ └── example.ex
│ └── services
│ ├── example.ex
│ └── user
│ └── user.ex
├── path
│ ├── adapters
│ │ ├── git_resolver.ex
│ │ ├── json_resolver.ex
│ │ ├── local_resolver.ex
│ │ ├── path_creator.ex
│ │ ├── path_resolver.ex
│ │ ├── template_directory.ex
│ │ └── template_file.ex
│ ├── logic
│ └── schemas
│ ├── template_directory.ex
│ └── template_file.ex
├── paths.ex
├── project
│ ├── adapters
│ │ └── project.ex
│ ├── logic
│ └── schemas
│ └── project.ex
├── projects.ex
├── template
│ ├── adapters
│ │ └── template.ex
│ ├── logic
│ └── schemas
│ └── template.ex
└── templates.ex