Просмотр исходного кода

Don't need to parse dependency if already fetched

This is necessary for dependencies that don't specify where they should
be fetched.
Rudi Grinberg 10 лет назад
Родитель
Сommit
afaf3edf53
1 измененных файлов с 9 добавлено и 8 удалено
  1. 9 8
      src/mad_deps.erl

+ 9 - 8
src/mad_deps.erl

@@ -21,16 +21,17 @@ fetch(_, _Config, _, []) -> ok;
 fetch(Cwd, Config, ConfigFile, [H|T]) when is_tuple(H) =:= false -> fetch(Cwd, Config, ConfigFile, T);
 fetch(Cwd, Config, ConfigFile, [H|T]) ->
     {Name, Repo} = name_and_repo(H),
-    {Cmd, Uri, Co} = case Repo of
-                         V={_, _, _}          -> V;
-                         {_Cmd, _Url, _Co, _} -> {_Cmd, _Url, _Co};
-                         {_Cmd, _Url}         -> {_Cmd, _Url, "master"}
-                     end,
-    Cmd1 = atom_to_list(Cmd),
-    Cache = mad_utils:get_value(cache, Config, deps_fetch),
     case get(Name) of
         fetched -> ok;
-        _ -> fetch_dep(Cwd, Config, ConfigFile, Name, Cmd1, Uri, Co, Cache)
+        _ ->
+            {Cmd, Uri, Co} = case Repo of
+                                 V={_, _, _}          -> V;
+                                 {_Cmd, _Url, _Co, _} -> {_Cmd, _Url, _Co};
+                                 {_Cmd, _Url}         -> {_Cmd, _Url, "master"}
+                             end,
+            Cmd1 = atom_to_list(Cmd),
+            Cache = mad_utils:get_value(cache, Config, deps_fetch),
+            fetch_dep(Cwd, Config, ConfigFile, Name, Cmd1, Uri, Co, Cache)
     end,
     fetch(Cwd, Config, ConfigFile, T).