Quick escript question

In the past, when I was more of an Erlang developer, I used to write escripts that would start with something like (with chmod +x set):

#!/usr/bin/escript

main(Args) ->
        error_logger:tty(false), % disable error reports
        try main0(Args) of
                R -> R

I can’t seem to figure out how to do this with Elixir? Yes, I can do mix escript.build, but that produces a rather large binary. Is it possible just to execute the .ex file?

Many thanks

1 Like

Just put the code in an .ex file and then elixir thefile.ex.

1 Like

I figured it out, since it’s not an executable I needed this at the end of the exs file Elixirfun.main(System.argv)