View Source mix mod.new (modkit v0.6.1)
Creates a new module in the current application, based on a template.
The location of the new module is defined according to the :mount
option in
:modkit
configuration defined in the project file (mix.exs
).
If not defined, default mount points are defined as follows:
[
{App, "lib/app"}
{Mix.Tasks, "lib/mix/tasks", flavor: :mix_task}
]
Usage
mix mod.new [options] <module>
Options
-g, --gen-server
- use GenServer and define base functions. Defaults tofalse
.-s, --supervisor
- use Supervisor and define base functions. Defaults tofalse
.-d, --dynamic-supervisor
- use DynamicSupervisor and define base functions. Defaults tofalse
.-p, --path <string>
- The path of the module to write. Unnecessary if the module prefix is mounted.-o, --overwrite
- Overwrite the file if it exists. Always prompt. Defaults tofalse
.--help
- Displays this help.