Browse Source

release erorr handling and fix app.src compilation

Namdak Tonpa 10 years ago
parent
commit
d376a480a6
5 changed files with 6 additions and 5 deletions
  1. BIN
      mad
  2. 1 1
      src/mad.erl
  3. 2 1
      src/mad_compile.erl
  4. 2 2
      src/mad_release.erl
  5. 1 1
      src/mad_utils.erl

BIN
mad


+ 1 - 1
src/mad.erl

@@ -94,7 +94,7 @@ stop(_Cwd,_ConfigFileName,_Config,Params) ->
 
 release(_Cwd,_ConfigFileName,_Config,Params) ->
     io:format("Release Params: ~p~n",[Params]),
-    mad_release:main(Params), false.
+    mad_release:main(Params).
 
 static(_Cwd,_ConfigFileName,Config,Params) ->
     io:format("Compile Static Params: ~p~n",[Params]),

+ 2 - 1
src/mad_compile.erl

@@ -69,7 +69,8 @@ compile_files([],Inc,Bin,Opt,Deps) -> false;
 compile_files([File|Files],Inc,Bin,Opt,Deps) ->
     case (module(filetype(File))):compile(File,Inc,Bin,Opt,Deps) of
          true -> true;
-         false -> compile_files(Files,Inc,Bin,Opt,Deps) end.
+         false -> compile_files(Files,Inc,Bin,Opt,Deps);
+         _ -> io:format("Error: ~p~n",[{File}]) end.
 
 module("erl") -> mad_erl;
 module("erl.src") -> mad_utils;

+ 2 - 2
src/mad_release.erl

@@ -17,5 +17,5 @@ main(Params) ->
     release(N,Apps),
     {_,Status,X} = sh:run("relx",[],binary,".",[]),
     case Status == 0 of
-         true -> skip;
-         false -> io:format("Shell Error: ~s~n\r",[binary_to_list(X)]) end.
+         true -> false;
+         false -> io:format("Shell Error: ~s~n\r",[binary_to_list(X)]), true end.

+ 1 - 1
src/mad_utils.erl

@@ -99,5 +99,5 @@ fold_params(Params) ->
            E -> {[E|Current],Result} end
       end, {[],[]}, Atomized).
 
-compile(_,_,_,_,_) -> ok.
+compile(_,_,_,_,_) -> false.