Skip to content

Commit

Permalink
Fix phx.gen.release ecto_sql check (phoenixframework#4796)
Browse files Browse the repository at this point in the history
Sometimes in a project where everything is already compiled, The
`mix phx.gen.release` task cannot correctly detect if ecto_sql is
already installed or not. This is because the ecto_sql is in fact not
loaded yet. To resolve this we can either try to load ecto_sql using
`Application.load(:ecto_sql)` before fetching the loaded apps or simply
use the `Mix.Project.deps_apps` to see if `ecto_sql` is there.

This commit implemented the latter.
  • Loading branch information
alisinabh authored Apr 18, 2022
1 parent c7b28d6 commit 0480bd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mix/tasks/phx.gen.release.ex
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,5 @@ defmodule Mix.Tasks.Phx.Gen.Release do
end
end

defp ecto_sql_installed?, do: Application.loaded_applications() |> List.keymember?(:ecto_sql, 0)
defp ecto_sql_installed?, do: Mix.Project.deps_apps() |> Enum.member?(:ecto_sql)
end

0 comments on commit 0480bd6

Please sign in to comment.