Skip to content

Commit 7d2f62f

Browse files
authored
Silent instead of displaying error message when a target is unavailable (#76)
1 parent a13cad8 commit 7d2f62f

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

lib/mix/tasks/compile.elixir_make.ex

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -156,31 +156,28 @@ defmodule Mix.Tasks.Compile.ElixirMake do
156156

157157
with false <- File.exists?(load_path),
158158
{:error, message} <- download_or_reuse_nif(config, precompiler, app_priv) do
159-
{recover, error_msg} =
159+
recover =
160160
case message do
161-
{:unavailable_target, current_target, msg} ->
161+
{:unavailable_target, current_target, _description} ->
162162
if function_exported?(precompiler, :unavailable_target, 1) do
163-
{precompiler.unavailable_target(current_target), msg}
163+
precompiler.unavailable_target(current_target)
164164
else
165-
{:compile, msg}
165+
:compile
166166
end
167167

168168
_ ->
169-
{:compile, message}
170-
end
171-
172-
case recover do
173-
:compile ->
174-
Mix.shell().error("""
175-
Error happened while installing #{app} from precompiled binary: #{error_msg}.
169+
Mix.shell().error("""
170+
Error happened while installing #{app} from precompiled binary: #{inspect(message)}.
176171
177-
Attempting to compile #{app} from source...\
178-
""")
172+
Attempting to compile #{app} from source...\
173+
""")
179174

180-
precompiler.build_native(args)
175+
:compile
176+
end
181177

182-
:ignore ->
183-
{:ok, []}
178+
case recover do
179+
:compile -> precompiler.build_native(args)
180+
:ignore -> {:ok, []}
184181
end
185182
else
186183
_ -> {:ok, []}

0 commit comments

Comments
 (0)