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 to false.
  • -s, --supervisor - use Supervisor and define base functions. Defaults to false.
  • -d, --dynamic-supervisor - use DynamicSupervisor and define base functions. Defaults to false.
  • -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 to false.
  • --help - Displays this help.