diff options
author | Heinz N. Gies <heinz@licenser.net> | 2015-08-31 07:24:49 +0200 |
---|---|---|
committer | Heinz N. Gies <heinz@licenser.net> | 2015-08-31 22:30:40 +0200 |
commit | 93549dcdd6ad64c0b870cd36f4d67da4f135841c (patch) | |
tree | e57a2d9b377d3122310704eb6138c369f8f15b11 /src | |
parent | caf8ff31d8edfd1cbe022d4ed173a399afd67c0f (diff) |
Removed extra | for last element in tree
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_prv_deps_tree.erl | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/src/rebar_prv_deps_tree.erl b/src/rebar_prv_deps_tree.erl index d429c52..d794bfa 100644 --- a/src/rebar_prv_deps_tree.erl +++ b/src/rebar_prv_deps_tree.erl @@ -51,24 +51,29 @@ print_deps_tree(SrcDeps, Verbose, State) -> ,project} || App <- rebar_state:project_apps(State)], case dict:find(root, D) of {ok, Children} -> - print_children(-1, lists:keysort(1, Children++ProjectAppNames), D, Verbose); + print_children("", lists:keysort(1, Children++ProjectAppNames), D, Verbose); error -> - print_children(-1, lists:keysort(1, ProjectAppNames), D, Verbose) + print_children("", lists:keysort(1, ProjectAppNames), D, Verbose) end. print_children(_, [], _, _) -> ok; -print_children(Indent, [{Name, Vsn, Source} | Rest], Dict, Verbose) -> - - [io:format("| ") || _ <- lists:seq(0, Indent, 2)], - io:format("|- "), +print_children(Prefix, [{Name, Vsn, Source} | Rest], Dict, Verbose) -> + Prefix1 = case Rest of + [] -> + io:format("~s`- ", [Prefix]), + [Prefix, " "]; + _ -> + io:format("~s|- ", [Prefix]), + [Prefix, "| "] + end, io:format("~s-~s (~s)~n", [Name, Vsn, type(Source, Verbose)]), case dict:find(Name, Dict) of {ok, Children} -> - print_children(Indent+2, lists:keysort(1, Children), Dict, Verbose), - print_children(Indent, Rest, Dict, Verbose); + print_children(Prefix1, lists:keysort(1, Children), Dict, Verbose), + print_children(Prefix, Rest, Dict, Verbose); error -> - print_children(Indent, Rest, Dict, Verbose) + print_children(Prefix, Rest, Dict, Verbose) end. type(project, _) -> |