fix resolution of mix tasks

This commit is contained in:
FloatingGhost 2022-08-16 23:50:31 +01:00
parent e5a11a6399
commit 45aec319dd

View file

@ -25,7 +25,7 @@ defp mix_task(task, args) do
module = Module.split(module) module = Module.split(module)
match?(["Mix", "Tasks", "Pleroma" | _], module) and match?(["Mix", "Tasks", "Pleroma" | _], module) and
String.downcase(List.last(module)) == task task_match?(module, task)
end) end)
if module do if module do
@ -35,6 +35,13 @@ defp mix_task(task, args) do
end end
end end
defp task_match?(module_path, task) do
module_path
|> Enum.join(".")
|> String.downcase()
|> String.ends_with?(String.downcase(task))
end
def migrate(args) do def migrate(args) do
Mix.Tasks.Pleroma.Ecto.Migrate.run(args) Mix.Tasks.Pleroma.Ecto.Migrate.run(args)
end end