Ecto tasks: Resolve relative path using the application directory

instead of cwd and load the application before doing anything

In OTP releases cwd != app directory and the configuration is read
only if the application is loaded
This commit is contained in:
rinpatch 2019-06-22 04:17:04 +03:00
commit ebee9f59d8
4 changed files with 18 additions and 1 deletions

View file

@ -4,6 +4,7 @@
defmodule Mix.Tasks.Pleroma.Ecto.Rollback do
use Mix.Task
import Mix.Pleroma
require Logger
@shortdoc "Wrapper on `ecto.rollback` task"
@ -36,6 +37,7 @@ defmodule Mix.Tasks.Pleroma.Ecto.Rollback do
@impl true
def run(args \\ []) do
load_pleroma()
{opts, _} = OptionParser.parse!(args, strict: @switches, aliases: @aliases)
opts =