aboutsummaryrefslogtreecommitdiff
path: root/lib/mix/tasks/pleroma/frontend.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mix/tasks/pleroma/frontend.ex')
-rw-r--r--lib/mix/tasks/pleroma/frontend.ex36
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/mix/tasks/pleroma/frontend.ex b/lib/mix/tasks/pleroma/frontend.ex
new file mode 100644
index 000000000..f15dbc38b
--- /dev/null
+++ b/lib/mix/tasks/pleroma/frontend.ex
@@ -0,0 +1,36 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Mix.Tasks.Pleroma.Frontend do
+ use Mix.Task
+
+ import Mix.Pleroma
+
+ @shortdoc "Manages bundled Pleroma frontends"
+
+ @moduledoc File.read!("docs/administration/CLI_tasks/frontend.md")
+
+ def run(["install", "none" | _args]) do
+ shell_info("Skipping frontend installation because none was requested")
+ "none"
+ end
+
+ def run(["install", frontend | args]) do
+ start_pleroma()
+
+ {options, [], []} =
+ OptionParser.parse(
+ args,
+ strict: [
+ ref: :string,
+ static_dir: :string,
+ build_url: :string,
+ build_dir: :string,
+ file: :string
+ ]
+ )
+
+ Pleroma.Frontend.install(frontend, options)
+ end
+end