Browse Source

rebar.config errro proper notice #86

Namdak Tonpa 6 years ago
parent
commit
5be2f09cef
5 changed files with 5 additions and 5 deletions
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 2 2
      src/compile/mad_compile.erl
  4. 1 1
      src/mad_git.erl
  5. 1 1
      src/mad_utils.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"044bd9").
+-define(VERSION,"e1aeb1").

BIN
mad


+ 2 - 2
src/compile/mad_compile.erl

@@ -4,7 +4,7 @@
 
 
 compile(Params) ->
 compile(Params) ->
     case mad_utils:configs() of
     case mad_utils:configs() of
-         {error,_} -> {error,"rebar.config error on compile."};
+         {error,E} -> {error,E};
          {ok,{ Cwd, ConfigFile, Conf }} ->
          {ok,{ Cwd, ConfigFile, Conf }} ->
            Res = case Params of
            Res = case Params of
                  [] -> mad_compile:'compile-deps'(Cwd, ConfigFile, Conf);
                  [] -> mad_compile:'compile-deps'(Cwd, ConfigFile, Conf);
@@ -34,7 +34,7 @@ dep(Cwd, _Conf, ConfigFile, Name) ->
 
 
     DepConfig = filename:join(DepPath, ConfigFile),
     DepConfig = filename:join(DepPath, ConfigFile),
     case mad_utils:consult(DepConfig) of
     case mad_utils:consult(DepConfig) of
-         {error,_} -> {error, <<"rebar.config is missing.">>};
+         {error,E} -> {error,E};
          {ok,Conf} ->
          {ok,Conf} ->
     Conf1     = mad_script:script(DepConfig, Conf, Name),
     Conf1     = mad_script:script(DepConfig, Conf, Name),
     Deps      = mad_utils:get_value(deps, Conf1, []),
     Deps      = mad_utils:get_value(deps, Conf1, []),

+ 1 - 1
src/mad_git.erl

@@ -88,7 +88,7 @@ fetch_dep(Cwd, Config, ConfigFile, Name, Cmd, Uri, Co, Cache, Deep) ->
                     TrunkConfigFile = filename:join(TrunkPath, ConfigFile),
                     TrunkConfigFile = filename:join(TrunkPath, ConfigFile),
                     Conf0 = mad_utils:consult(TrunkConfigFile),
                     Conf0 = mad_utils:consult(TrunkConfigFile),
                     case Conf0 of
                     case Conf0 of
-                         {error,_} -> {error, <<"rebar.config error">>};
+                         {error,E} -> {error,E};
                          {ok,Conf} ->
                          {ok,Conf} ->
                     Conf1 = mad_utils:script(TrunkConfigFile, Conf, Name),
                     Conf1 = mad_utils:script(TrunkConfigFile, Conf, Name),
                     case Deep of
                     case Deep of

+ 1 - 1
src/mad_utils.erl

@@ -15,7 +15,7 @@ cwd() -> {ok, Cwd} = file:get_cwd(), Cwd.
 home() -> {ok, [[H|_]]} = init:get_argument(home), H.
 home() -> {ok, [[H|_]]} = init:get_argument(home), H.
 consult(File) -> case file:consult(filename:absname(File)) of
 consult(File) -> case file:consult(filename:absname(File)) of
                       {error,enoent} -> {ok,[]};
                       {error,enoent} -> {ok,[]};
-                      {error,E} -> {error,E};
+                      {error,E} -> {error,"rebar.config error:\n"++io_lib:format("~p\n",[E])};
                       {ok,V} -> {ok,V} end.
                       {ok,V} -> {ok,V} end.
 
 
 src(Dir) -> filename:join(Dir, "src").
 src(Dir) -> filename:join(Dir, "src").