Alex Antonov
Alex Antonov

Reputation: 15156

How to implement some commands on starting iex session?

Let say I want to implement a few commands on starting iex in root path of my project, like:

Logger.configure(level: :info)
require Ecto.Query
alias MyApp.User
# and so on

And I want to implement all of these commands on every starting of iex automatically. Another thing I want - is to make this setting only for one project (for example, I wouldn't have MyApp.User on another project, so I don't need to use it accross all iex of the system). How can I do that?

Upvotes: 3

Views: 221

Answers (1)

Alex de Sousa
Alex de Sousa

Reputation: 1591

In your project root create a file called .iex.exs and add the commands there. That should do the trick.

Upvotes: 5

Related Questions