1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.ReleaseTasks do
7 [task | args] = String.split(args)
10 "migrate" -> migrate(args)
11 task -> mix_task(task, args)
15 defp mix_task(task, args) do
16 # Modules are not loaded before application starts
17 Mix.Tasks.Pleroma.Common.start_pleroma()
18 {:ok, modules} = :application.get_key(:pleroma, :modules)
21 Enum.find(modules, fn module ->
22 module = Module.split(module)
24 match?(["Mix", "Tasks", "Pleroma" | _], module) and
25 String.downcase(List.last(module)) == task
31 IO.puts("The task #{task} does not exist")
35 defp migrate(_args) do