X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=inline;f=lib%2Fpleroma%2Frelease_tasks.ex;h=75c0271377a0629f06f1e64d41acf676ffa64c77;hb=af7c3fab98f4f5d1fa541035fd8b2821e0abb77b;hp=8afabf463f9ebc165a3d06a8b61ec434bf351dd3;hpb=3a71016699d824b87f1ec26dd2659d770eb525d7;p=akkoma
diff --git a/lib/pleroma/release_tasks.ex b/lib/pleroma/release_tasks.ex
index 8afabf463..75c027137 100644
--- a/lib/pleroma/release_tasks.ex
+++ b/lib/pleroma/release_tasks.ex
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ReleaseTasks do
@@ -25,7 +25,7 @@ defmodule Pleroma.ReleaseTasks do
module = Module.split(module)
match?(["Mix", "Tasks", "Pleroma" | _], module) and
- String.downcase(List.last(module)) == task
+ task_match?(module, task)
end)
if module do
@@ -35,6 +35,13 @@ defmodule Pleroma.ReleaseTasks do
end
end
+ defp task_match?(["Mix", "Tasks", "Pleroma" | module_path], task) do
+ module_path
+ |> Enum.join(".")
+ |> String.downcase()
+ |> String.equivalent?(String.downcase(task))
+ end
+
def migrate(args) do
Mix.Tasks.Pleroma.Ecto.Migrate.run(args)
end
@@ -54,9 +61,6 @@ defmodule Pleroma.ReleaseTasks do
IO.puts("The database for #{inspect(@repo)} has already been created")
{:error, term} when is_binary(term) ->
- IO.puts(:stderr, "The database for #{inspect(@repo)} couldn't be created: #{term}")
-
- {:error, term} ->
IO.puts(
:stderr,
"The database for #{inspect(@repo)} couldn't be created: #{inspect(term)}"