Packages
A modular, open templating system, designed for use with `mix gen`. You care about this if: ① you'd like different templates than the ones built in to mix, ② you'd like to create your own templates, or ③ you have created a package such as Phoenix or Nerves that needs its own project se...
Current section
Files
Jump to
Current section
Files
lib/mix_templates/specs.ex
defmodule MixTemplates.Specs do
alias MixTemplates.Cache
@doc """
Extra the specs (command line options that this template uses) from a
a template and all its parents.
"""
def accumulate_specs(template, base_option_specs) do
if parent_name = template.based_on() do
parent_module = Cache.find_template(parent_name)
template.options() ++ accumulate_specs(parent_module, base_option_specs)
else
template.options() ++ base_option_specs
end
end
end