Skip to content

Commit 660862d

Browse files
authored
Merge pull request #959 from llelf/mapdeps.erl
fix mapdeps.erl
2 parents 3cf404d + 26e65b1 commit 660862d

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

misc/mapdeps.erl

+14-3
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,17 @@ map_rebar(BaseDir, Path, Acc) ->
8585
{ok, Opts} ->
8686
Deps = proplists:get_value(deps, Opts, []),
8787
lists:foldl(
88-
fun({DepName, _, {_,_,V} }, A) ->
88+
fun(Dep, A) ->
89+
{DepName,VerStr} =
90+
case Dep of
91+
{N, {_,_,V}} -> {N, ver(V)};
92+
{N, {_,_} } -> {N, "HEAD"};
93+
{N, _, {_,_,V}} -> {N, ver(V)};
94+
{N, _, {_,_} } -> {N, "HEAD"};
95+
{N, _} when is_atom(N) -> {N, "'hex'"};
96+
N when is_atom(N) -> {N, "'hex'"}
97+
end,
8998
From = app_name(Path),
90-
VerStr = ver(V),
9199
To = {atom_to_list(DepName), VerStr},
92100
case ordsets:is_element({To, From}, A) of
93101
true ->
@@ -115,7 +123,10 @@ app_name(Path) ->
115123
filename:basename(filename:dirname(Path)).
116124

117125
file_start() ->
118-
io:format(standard_io, "digraph {~n", []).
126+
io:format(standard_io,
127+
"digraph {~n"
128+
" graph [ overlap=scale ]~n~n",
129+
[]).
119130

120131
file_end() ->
121132
io:format(standard_io, "}~n", []).

0 commit comments

Comments
 (0)