# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-2021 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
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
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
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")
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)}"