diff options
author | Alex Gleason <alex@alexgleason.me> | 2021-06-14 14:58:37 -0500 |
---|---|---|
committer | Alex Gleason <alex@alexgleason.me> | 2021-06-14 15:00:00 -0500 |
commit | a9106e4f13fa3ad6d0dbddd0f4f4e0647875b58c (patch) | |
tree | d671b2d896bdd3c4be24449613fa8432e39c76c5 /lib/mix | |
parent | b221d77a6da07c684bdbc63ddf4500e0d7ffeae8 (diff) | |
download | pleroma-a9106e4f13fa3ad6d0dbddd0f4f4e0647875b58c.tar.gz |
Frontends: refactor with %Frontend{} struct
Diffstat (limited to 'lib/mix')
-rw-r--r-- | lib/mix/tasks/pleroma/frontend.ex | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/mix/tasks/pleroma/frontend.ex b/lib/mix/tasks/pleroma/frontend.ex index 8334e0049..9b151c3bd 100644 --- a/lib/mix/tasks/pleroma/frontend.ex +++ b/lib/mix/tasks/pleroma/frontend.ex @@ -7,6 +7,8 @@ defmodule Mix.Tasks.Pleroma.Frontend do import Mix.Pleroma + alias Pleroma.Frontend + @shortdoc "Manages bundled Pleroma frontends" @moduledoc File.read!("docs/administration/CLI_tasks/frontend.md") @@ -16,7 +18,7 @@ defmodule Mix.Tasks.Pleroma.Frontend do "none" end - def run(["install", frontend | args]) do + def run(["install", name | args]) do start_pleroma() {options, [], []} = @@ -24,13 +26,19 @@ defmodule Mix.Tasks.Pleroma.Frontend do args, strict: [ ref: :string, - static_dir: :string, build_url: :string, build_dir: :string, file: :string ] ) - Pleroma.Frontend.install(frontend, options) + options + |> Keyword.put(:name, name) + |> opts_to_frontend() + |> Frontend.install() + end + + defp opts_to_frontend(opts) do + struct(Frontend, opts) end end |