summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-06-10 13:02:08 -0500
committerMark Felder <feld@FreeBSD.org>2020-06-10 13:02:08 -0500
commit7c47f791a803aa5cee2f2f6931b8445d2c0551e5 (patch)
tree43c43558e4a949cbd7c426d29958b5106d67599d
parent7aa6c82937090ca6f2298dee0ef894954ca2f129 (diff)
downloadpleroma-7c47f791a803aa5cee2f2f6931b8445d2c0551e5.tar.gz
pleroma-7c47f791a803aa5cee2f2f6931b8445d2c0551e5.zip
Add command to reload emoji packs from cli for OTP users
Not useful for source releases as we don't have a way to automate connecting to the running instance.
-rw-r--r--docs/administration/CLI_tasks/emoji.md8
-rw-r--r--lib/mix/tasks/pleroma/emoji.ex6
2 files changed, 14 insertions, 0 deletions
diff --git a/docs/administration/CLI_tasks/emoji.md b/docs/administration/CLI_tasks/emoji.md
index 3d524a52b..ddcb7e62c 100644
--- a/docs/administration/CLI_tasks/emoji.md
+++ b/docs/administration/CLI_tasks/emoji.md
@@ -44,3 +44,11 @@ Currently, only .zip archives are recognized as remote pack files and packs are
The manifest entry will either be written to a newly created `pack_name.json` file (pack name is asked in questions) or appended to the existing one, *replacing* the old pack with the same name if it was in the file previously.
The file list will be written to the file specified previously, *replacing* that file. You _should_ check that the file list doesn't contain anything you don't need in the pack, that is, anything that is not an emoji (the whole pack is downloaded, but only emoji files are extracted).
+
+## Reload emoji packs
+
+```sh tab="OTP"
+./bin/pleroma_ctl emoji reload
+```
+
+This command only works with OTP releases.
diff --git a/lib/mix/tasks/pleroma/emoji.ex b/lib/mix/tasks/pleroma/emoji.ex
index 29a5fa99c..f4eaeac98 100644
--- a/lib/mix/tasks/pleroma/emoji.ex
+++ b/lib/mix/tasks/pleroma/emoji.ex
@@ -237,6 +237,12 @@ defmodule Mix.Tasks.Pleroma.Emoji do
end
end
+ def run(["reload"]) do
+ start_pleroma()
+ Pleroma.Emoji.reload()
+ IO.puts("Emoji packs have been reloaded.")
+ end
+
defp fetch_and_decode(from) do
with {:ok, json} <- fetch(from) do
Jason.decode!(json)