aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-09-17 22:22:59 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-09-17 22:22:59 +0300
commita42880040574701000470fc1c2dbd6f7242c1a06 (patch)
tree666d244b9bf4f38b4421deea8d3b8bbb10ec179e /lib/mix/tasks
parentd9fb5bc08ad67b55d0cd25c1a0d7d3a740758427 (diff)
parent7bf269fe836ded974d2187c6b36eba4ab185ff25 (diff)
downloadpleroma-a42880040574701000470fc1c2dbd6f7242c1a06.tar.gz
Merge remote-tracking branch 'remotes/origin/develop' into media-preview-proxy-nostream
# Conflicts: # CHANGELOG.md
Diffstat (limited to 'lib/mix/tasks')
-rw-r--r--lib/mix/tasks/pleroma/config.ex10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/mix/tasks/pleroma/config.ex b/lib/mix/tasks/pleroma/config.ex
index 904c5a74b..18f99318d 100644
--- a/lib/mix/tasks/pleroma/config.ex
+++ b/lib/mix/tasks/pleroma/config.ex
@@ -32,7 +32,8 @@ defmodule Mix.Tasks.Pleroma.Config do
@spec migrate_to_db(Path.t() | nil) :: any()
def migrate_to_db(file_path \\ nil) do
- if Pleroma.Config.get([:configurable_from_database]) do
+ with true <- Pleroma.Config.get([:configurable_from_database]),
+ :ok <- Pleroma.Config.DeprecationWarnings.warn() do
config_file =
if file_path do
file_path
@@ -46,7 +47,8 @@ defmodule Mix.Tasks.Pleroma.Config do
do_migrate_to_db(config_file)
else
- migration_error()
+ :error -> deprecation_error()
+ _ -> migration_error()
end
end
@@ -120,6 +122,10 @@ defmodule Mix.Tasks.Pleroma.Config do
)
end
+ defp deprecation_error do
+ shell_error("Migration is not allowed until all deprecation warnings have been resolved.")
+ end
+
if Code.ensure_loaded?(Config.Reader) do
defp config_header, do: "import Config\r\n\r\n"
defp read_file(config_file), do: Config.Reader.read_imports!(config_file)