1 defmodule Mix.Tasks.Pleroma.Common do
2 @shortdoc "Common functions to be reused in mix tasks"
4 Mix.Task.run("app.start")
7 def get_option(options, opt, prompt, defval \\ nil, defname \\ nil) do
8 Keyword.get(options, opt) ||
9 case Mix.shell().prompt("#{prompt} [#{defname || defval}]") do
12 nil -> get_option(options, opt, prompt, defval)
21 def escape_sh_path(path) do
22 ~S(') <> String.replace(path, ~S('), ~S(\')) <> ~S(')