Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run multiple mix tasks in one command

Tags:

elixir

I have multiple mix tasks to run in succession. With other build tools, it is possible to run the tasks with a single statement, which saves any startup overhead after the first task. How can this be done with Elixir's mix command?

like image 742
Moxley Stratton Avatar asked May 03 '16 04:05

Moxley Stratton


1 Answers

Comma-separate the list of tasks, and add them to mix do: mix do task1, task2, task3:

mix do deps.get, run hello.exs, ecto.migrate

For example, the above runs the tasks deps.get, run hello.exs, and ecto.migrate within one invocation of mix.

like image 172
Moxley Stratton Avatar answered Sep 28 '22 07:09

Moxley Stratton