Maxim Sokhatsky 10 years ago
parent
commit
bf066e6001
4 changed files with 9 additions and 5 deletions
  1. BIN
      mad
  2. 5 2
      src/mad.erl
  3. 3 2
      src/mad_repl.erl
  4. 1 1
      src/mad_tool.erl

BIN
mad


+ 5 - 2
src/mad.erl

@@ -48,11 +48,14 @@ plan(Cwd,ConfigFileName,Config,Params) ->
     mad_plan:main(mad_plan:applist()).
 
 repl(Cwd,ConfigFileName,Config,Params) ->
-    mad_console:main(Params).
+    mad_repl:main(Params).
+
+tool(Cwd,ConfigFileName,Config,Params) ->
+    mad_tool:main(filename:basename(mad_utils:cwd())).
 
 help(Reason, Data) -> help(io_lib:format("~s ~p", [Reason, Data])).
 help(Msg) -> io:format("Error: ~s~n~n", [Msg]), help().
 help() ->
     io:format("SRC VXZ MAD Build Tool version 1.0~n"),
-    io:format("mad deps compile plan start stop repl attach release ~n"),
+    io:format("mad deps compile plan start stop repl attach release tool ~n"),
     halt().

+ 3 - 2
src/mad_console.erl → src/mad_repl.erl

@@ -1,4 +1,4 @@
--module(mad_console).
+-module(mad_repl).
 -compile(export_all).
 
 main(Params) ->
@@ -11,4 +11,5 @@ main(Params) ->
               io:format("~p : ~p = ~p~n",[App,K,V]),
               application:set_env(App,K,V) end || {K,V} <- Cfg ]  || {App,Cfg} <- Apps]
              end,
-   [application:start(A)||A<-mad_plan:applist()], user_drv:start(), timer:sleep(infinity).
+   [application:start(A)||A<-mad_plan:applist()], shell:start(),
+   timer:sleep(infinity).

+ 1 - 1
src/mad_tool.erl

@@ -11,6 +11,6 @@ read_file(File) -> {ok, Bin} = file:read_file(filename:absname(File)), Bin.
 
 files() ->
     [{filename:basename(F), read_file(F)}
-     || F <- filelib:wildcard(filename:join("ebin", "*")) ++
+     || F <- filelib:wildcard(              filename:join("ebin", "*")) ++
              filelib:wildcard(filename:join(["apps", "*", "ebin", "*"])) ++
              filelib:wildcard(filename:join(["deps", "*", "ebin", "*"]))].