How do I set the default Elixir mix task

后端 未结 1 1298
余生分开走
余生分开走 2021-01-11 20:16

If I have a mix.exs file something like:

defmodule Mix.Tasks.My_task do
  use Mix.Task

  @shortdoc \"Perform my task\"

  def run(_) do
    IO.         


        
相关标签:
1条回答
  • 2021-01-11 20:47

    It looks like you can define inside the project block (mix.exs) using default_task:

    def project do
      [default_task: "run"]
    end
    

    More info: https://github.com/elixir-lang/elixir/blob/f3f64cdba205253ca0bbc0ce6a5ffffdd500ffb48f/lib/mix/lib/mix/project.ex#L266-L280

    0 讨论(0)
提交回复
热议问题