Task not found for custom blending task

I have a Thing task in lib / mix / tasks / thing.exs

Code:

defmodule Mix.Tasks.Thing do use Mix.Task def run(_) do IO.puts "hello world" end end 

When I run the mix thing or mix thing , I get The task thing could not be found or The task thing could not be found

I tried running mix compile in advance, which did not help.

I also tried putting the code from this question directly into my mix.exs, as shown in this question. I still could not complete the task.

+5
source share
1 answer

Mixing tasks must be compiled. If you rename from lib/mix/tasks/thing.exs to lib/mix/tasks/thing.ex , then it should work.

More information about script mode (.exs) can be found at: http://elixir-lang.org/getting-started/modules.html#scripted-mode

+5
source

All Articles