Skip to content

Commit 4171e47

Browse files
authored
Apply suggestions from code review
1 parent 45a577c commit 4171e47

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/mix/lib/mix/tasks/help.ex

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,18 @@ defmodule Mix.Tasks.Help do
113113
def run(["app:" <> app]) do
114114
loadpaths!()
115115

116-
if Mix.Project.get() do
117-
Mix.Task.run("compile")
118-
end
119-
120116
app = String.to_atom(app)
121117

122118
# If the application is not available, attempt to load it from Erlang/Elixir
123119
if is_nil(Application.spec(app, :vsn)) do
124-
if Mix.Project.get() do
125-
Mix.Task.run("compile")
120+
try do
121+
Mix.ensure_application!(app)
122+
rescue
123+
_ ->
124+
if Mix.Project.get() do
125+
Mix.Task.run("compile")
126+
end
127+
end
126128
end
127129
end
128130

0 commit comments

Comments
 (0)