diff options
-rw-r--r-- | lib/mix/tasks/pleroma/frontend.ex | 9 | ||||
-rw-r--r-- | test/tasks/frontend_test.exs | 7 |
2 files changed, 11 insertions, 5 deletions
diff --git a/lib/mix/tasks/pleroma/frontend.ex b/lib/mix/tasks/pleroma/frontend.ex index 7ddd9360a..865daf3bb 100644 --- a/lib/mix/tasks/pleroma/frontend.ex +++ b/lib/mix/tasks/pleroma/frontend.ex @@ -35,18 +35,17 @@ defmodule Mix.Tasks.Pleroma.Frontend do configs = Pleroma.Config.get(:frontends, %{}) - with config <- configs[:primary], - frontend <- config["name"], + with config when not is_nil(config) <- configs[:primary], ref when ref != "none" <- config["ref"] do - run(["install", frontend, "--ref", ref]) + run(["install", config["name"], "--ref", ref]) end - with config <- configs[:mastodon], + with config when not is_nil(config) <- configs[:mastodon], ref when ref != "none" <- config["ref"] do run(["install", "mastodon", "--ref", ref]) end - with config <- configs[:admin], + with config when not is_nil(config) <- configs[:admin], ref when ref != "none" <- config["ref"] do run(["install", "admin", "--ref", ref]) end diff --git a/test/tasks/frontend_test.exs b/test/tasks/frontend_test.exs index 6c67255e5..f2893b725 100644 --- a/test/tasks/frontend_test.exs +++ b/test/tasks/frontend_test.exs @@ -134,5 +134,12 @@ defmodule Mix.Tasks.Pleroma.FrontendTest do assert {:ok, []} == File.ls(@dir) end + + test "Missing configs" do + clear_config(:frontends, []) + Mix.Tasks.Pleroma.Frontend.run(["install", "all"]) + + assert {:ok, []} == File.ls(@dir) + end end end |