mix_generator icon indicating copy to clipboard operation
mix_generator copied to clipboard

MixTemplates.Specs.accumulate_specs/1 is accumulate_specs/2

Open aseigo opened this issue 8 years ago • 2 comments

After mix archive.installing mix_generator and mix_templates (and then installing the project template via mix template.install), running mix gen project myapp results in this error:

[aseigo@localhost src]$ mix gen project foo ** (UndefinedFunctionError) function MixTemplates.Specs.accumulate_specs/1 is undefined or private. Did you mean one of:

  * accumulate_specs/2

MixTemplates.Specs.accumulate_specs(Mix.Gen.Template.Project)
lib/mix/tasks/gen.ex:155: Mix.Tasks.Gen.build_options/2
lib/mix/tasks/gen.ex:137: Mix.Tasks.Gen.generate_project/4
(mix) lib/mix/task.ex:294: Mix.Task.run_task/3
(mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2

And indeed, in MixTemplates.Specs we see:

def accumulate_specs(template, base_option_specs) do

but in build_options(template, args) in lib/mix/tasks/gen.ex there is:

specs = Specs.accumulate_specs(template)

.... not sure if you want to provide a default for base_option_specs or pass in an empty list from build_options (otherwise I'd throw you a one-liner patch :)

aseigo avatar Apr 28 '17 13:04 aseigo

I have a PR to fix this open here.

danielberkompas avatar Apr 28 '17 13:04 danielberkompas

Yep, that works indeed ... :)

aseigo avatar Apr 28 '17 13:04 aseigo