Browse Source

more ERROR handling

cryoflamer 8 years ago
parent
commit
2b32eb1edf
3 changed files with 3 additions and 2 deletions
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 2 1
      src/sources/mad_git.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"9ae8b1").
+-define(VERSION,"06c64e").

BIN
mad


+ 2 - 1
src/sources/mad_git.erl

@@ -91,10 +91,11 @@ pull(_,[])         -> {ok,[]};
 pull(Config,[F|T]) ->
     mad:info("==> up: ~p~n", [F]),
     {_,Status,Message} = sh:run(lists:concat(["cd ",F," && git pull && cd -"])),
+    %io:format("status: ~p~n",[{Status,Message}]),
     case Status of
          0 -> mad_utils:verbose(Config,Message), pull(Config,T);
          _ -> case binary:match(Message,[<<"You are not currently on a branch">>]) of
-                   nomatch -> mad_utils:verbose(Config,Message), true;
+                   nomatch -> mad_utils:verbose(Config,Message), {error,Message};
                    _ -> pull(Config,T) end end.
 
 up(Params) ->