Mix.Tasks.Run

Runs the given file or expression in the context of the application.

Before running the code, it invokes the app.start task which compiles and loads your project.

It is the goal of this task to provide a subset of the functionality existent in the elixir executable, including setting up the System.argv:

mix run -e Hello.world
mix run my_script.exs arg1 arg2 arg3

Many command line options need to be passed to the elixir executable directly, which can be done as follows:

elixir --sname hello -S mix run -e "My.code"

Command line options

Source

Summary

run(args)

Callback implementation of Mix.Task.run/1

Functions

run(args)

Callback implementation of Mix.Task.run/1.

Source