Load all erlang modules in path

前端 未结 2 1098
离开以前
离开以前 2021-01-12 18:45

Using the answer from Easy way of loading projects with rebar dependencies, dependencies are now automatically resolved, but they are not automatically loaded.

So, h

2条回答
  •  一向
    一向 (楼主)
    2021-01-12 19:35

    if you spawn the process, you will get a very fast start.

    LP = fun() -> [code:ensure_loaded(list_to_atom(filename:rootname(filename:basename(F)))) || P <- code:get_path(), F <- filelib:wildcard(P ++ "/*.beam")] end.
    spawn(LP).
    

    in the ~/.erlang file

提交回复
热议问题