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

@ -9,6 +9,10 @@ defmodule Mix.Pleroma do
{:ok, _} = Application.ensure_all_started(:pleroma)
end
def load_pleroma do
Application.load(:pleroma)
end
def get_option(options, opt, prompt, defval \\ nil, defname \\ nil) do
Keyword.get(options, opt) || shell_prompt(prompt, defval, defname)
end