I want to have a batch file that opens the command prompt, launches the iex shell within it and then starts my elixir program. The issue I'm having is that as soon as I invoke iex -S mix, which compiles the code and opens the elixir shell, then I am unable to write more commands into it.
:: Start iex and compile with mix
iex -S mix
:: Start elevators
Elevator.Supervisor.start
pause
The last part Elevator.Supervisor.start
never runs, for some reason. I guess this is because I opened a shell within the command prompt. Is there a way to feed commands into the iex?
TL;DR use .iex.exs
file which is loaded by iex
upon start.
.iex.exs
in the project directory root with the content you want to be run: Elevator.Supervisor.start()
.iex.exs
) from your .bat
file.bat
file