X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=inline;f=lib%2Fpleroma%2Frelease_tasks.ex;h=e43eef07095f24730153145715678597c9da540b;hb=a1515f9a606f6e5bdc2acb969cff2baad986efc4;hp=d6720cd0580dc5d2bcb1f3ccf6183e0de60b597a;hpb=f8c64dd4c0efec2a66d1082339ea850669662822;p=akkoma
diff --git a/lib/pleroma/release_tasks.ex b/lib/pleroma/release_tasks.ex
index d6720cd05..e43eef070 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
@@ -44,6 +51,8 @@ defmodule Pleroma.ReleaseTasks do
end
def create do
+ Application.load(:pleroma)
+
case @repo.__adapter__.storage_up(@repo.config) do
:ok ->
IO.puts("The database for #{inspect(@repo)} has been created")