Skip to content

Commit efaca6c

Browse files
Josh PriceJosé Valim
authored andcommitted
More informative message for DOT tree generation (#4791)
Signed-off-by: José Valim <[email protected]>
1 parent 67aabe0 commit efaca6c

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

lib/mix/lib/mix/tasks/app.tree.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,13 @@ defmodule Mix.Tasks.App.Tree do
5757
if opts[:format] == "dot" do
5858
Mix.Utils.write_dot_graph!("app_tree.dot", "application tree",
5959
{:normal, app}, callback, opts)
60-
Mix.shell.info "Generated \"app_tree.dot\" in current directory.\n" <>
61-
"You can use http://www.graphviz.org/ to open it."
60+
Mix.shell.info """
61+
Generated "app_tree.dot" in the current directory. To generate a PNG:
62+
63+
dot -Tpng app_tree.dot -o app_tree.png
64+
65+
For more options see http://www.graphviz.org/.
66+
""" |> String.strip
6267
else
6368
Mix.Utils.print_tree({:normal, app}, callback, opts)
6469
end

lib/mix/lib/mix/tasks/deps.tree.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,13 @@ defmodule Mix.Tasks.Deps.Tree do
5252
if opts[:format] == "dot" do
5353
callback = callback(&format_dot/1, deps, opts)
5454
Mix.Utils.write_dot_graph!("deps_tree.dot", "dependency tree", root, callback, opts)
55-
Mix.shell.info "Generated \"deps_tree.dot\" in current directory.\n" <>
56-
"You can use http://www.graphviz.org/ to open it."
55+
Mix.shell.info """
56+
Generated "deps_tree.dot" in the current directory. To generate a PNG:
57+
58+
dot -Tpng deps_tree.dot -o deps_tree.png
59+
60+
For more options see http://www.graphviz.org/.
61+
""" |> String.strip
5762
else
5863
callback = callback(&format_tree/1, deps, opts)
5964
Mix.Utils.print_tree(root, callback, opts)

lib/mix/lib/mix/utils.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ defmodule Mix.Utils do
214214
{"", seen}
215215
%{} when is_nil(edge_info) ->
216216
{~s( "#{parent}" -> "#{name}"\n),
217-
Map.put(seen, key, true),}
217+
Map.put(seen, key, true)}
218218
%{} ->
219219
{~s( "#{parent}" -> "#{name}" [label=\"#{edge_info}\"]\n),
220220
Map.put(seen, key, true)}

0 commit comments

Comments
 (0)