Browse Source

stops on wrong up

Namdak Tonpa 10 years ago
parent
commit
1cbb25e770
3 changed files with 5 additions and 4 deletions
  1. 1 1
      include/mad.hrl
  2. BIN
      mad
  3. 4 3
      src/mad_deps.erl

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"baa47a").
+-define(VERSION,"94547f").

BIN
mad


+ 4 - 3
src/mad_deps.erl

@@ -2,14 +2,15 @@
 -copyright('Sina Samavati').
 -compile(export_all).
 
-pull(Config,F) ->
+pull(_,[])         -> false;
+pull(Config,[F|T]) ->
     io:format("==> up: ~p~n", [F]),
     {_,Status,Message} = sh:run(io_lib:format("cd ~p && git pull && cd -",[F])),
     case Status of
-         0 -> mad_utils:verbose(Config,Message), false;
+         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;
-                   _ -> false end end.
+                   _ -> pull(Config,T) end end.
 
 up(Config,Params) ->
     List = case Params of