mad_run.erl 620 B

12345678910111213141516171819
  1. -module(mad_run).
  2. -compile(export_all).
  3. start(_) ->
  4. {_,Status,X} = sh:run("run_erl",["-daemon",".devbox/",".devbox/logs/","exec mad rep"],
  5. binary,".",
  6. [{"RUN_ERL_LOG_GENERATIONS","1000"},
  7. {"RUN_ERL_LOG_MAXSIZE","20000000"},
  8. {"ERL_LIBS","apps:deps"}]),
  9. case Status == 0 of
  10. true -> skip;
  11. false -> io:format("Shell Error: ~s~n\r",[binary_to_list(X)]), exit({error,X}) end.
  12. attach(_) ->
  13. io:format("to_erl .devbox/~n"). % use like $(mad attach)
  14. stop(_) -> ok. % TODO: stop box
  15. clean(_) -> [ file:delete(X) || X <- filelib:wildcard("{apps,deps}/*/ebin/**") ].