diff --git a/src/ext_mod.erl b/src/ext_mod.erl index dc4e96f2a..2228af99e 100644 --- a/src/ext_mod.erl +++ b/src/ext_mod.erl @@ -762,8 +762,10 @@ fetch_rebar_deps(SrcDir) -> {ok, CurDir} = file:get_cwd(), file:set_cwd(SrcDir), filelib:ensure_dir(filename:join("deps", ".")), - lists:foreach(fun({_App, Cmd}) -> - os:cmd("cd deps; "++Cmd++"; cd ..") + lists:foreach(fun({App, Cmd}) -> + io:format("Fetching dependency ~s: ", [App]), + Result = os:cmd("cd deps; "++Cmd++"; cd .."), + io:format("~s", [Result]) end, Deps), file:set_cwd(CurDir) end. @@ -777,6 +779,19 @@ rebar_deps(Script) -> _ -> [] end. + +rebar_dep({App, Version, Git}) when Version /= ".*" -> + AppS = atom_to_list(App), + Help = os:cmd("mix hex.package"), + case string:find(Help, "mix hex.package fetch") /= nomatch of + true -> + {App, "mix hex.package fetch "++AppS++" "++Version++" --unpack"}; + false -> + io:format("I'll download ~p using git because I can't use Mix " + "to fetch from hex.pm:~n~s", [AppS, help]), + rebar_dep({App, ".*", Git}) + end; + rebar_dep({App, _, {git, Url}}) -> {App, "git clone "++Url++" "++filename:basename(App)}; rebar_dep({App, _, {git, Url, {branch, Ref}}}) ->