Skip to content

The task which has a second name with underscore (compile.yo_yo) could not be found #684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Zatvobor opened this issue Dec 1, 2012 · 5 comments

Comments

@Zatvobor
Copy link
Contributor

Zatvobor commented Dec 1, 2012

GIVEN:
There are three identical task definitions

use Mix.Task

@shortdoc "Compile Dynamo source files"

def run(_) do
IO.puts @shortdoc
end

AND:
$ mix compile
=> Compiled lib/mix/tasks/yo.ex
=> Compiled lib/mix/tasks/compile.yo_yo.ex
=> Compiled lib/mix/tasks/compile.yo.ex

WHEN:
$ mix yo
=> Compile Dynamo source files

WHEN:
$ mix complile.yo
=> Compile Dynamo source files

BUT:

$ mix complile.yo_yo
=> The task compile.yo_yo could not be found

@josevalim
Copy link
Member

Just for curiosity, which module names were you using?

@josevalim
Copy link
Member

In any case, If you want to define a task compile.yo_yo, you need to define a module:

defmodule Compile.Yo_Yo

Let me know if you find further issues. :)

@Zatvobor
Copy link
Contributor Author

Zatvobor commented Dec 3, 2012

Something wrong with it.

I want to have the mix task which named as a compile.yo_yo

  • Mix.Tasks.Compile.Yo_Yo -> mix compile.yo_Yo
  • Mix.Tasks.Compile.YoYo -> mix yoYo

As for me it looks like a bug where expected result should be:

  • mix/tasks/compile.yo_yo.ex
  • defmodule Mix.Tasks.Compile.YoYo
  • mix compile.yo_yo

I'll fix that if you agree

@josevalim
Copy link
Member

Ops, sorry. You are correct. The module name should be Compile.Yo_yo. The reason why we don't support Compile.YoYo is because we haven't decided if YoYo should translate to yo_yo or yo-yo which is more common for command lines.

@Zatvobor
Copy link
Contributor Author

Zatvobor commented Dec 3, 2012

good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants