Skip to content

Commit

Permalink
Use function_exported?
Browse files Browse the repository at this point in the history
  • Loading branch information
Neylix committed Mar 29, 2023
1 parent c1d3052 commit dabb948
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/mix/tasks/migrate.ex
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,11 @@ defmodule Mix.Tasks.Archethic.Migrate do
|> Enum.map(fn {version, path} -> {version, Code.eval_file(path)} end)
|> Enum.filter(fn
{_version, {{:module, module, _, _}, _}} ->
case module.__info__(:functions) |> Keyword.has_key?(function) do
true ->
true

false ->
unload_module(module)
false
if function_exported?(module, function, 0) do
true
else
unload_module(module)
false
end

_ ->
Expand Down

0 comments on commit dabb948

Please sign in to comment.