non condition dir creation

This commit is contained in:
Alexander Strizhakov 2020-12-27 21:58:15 +03:00
parent 546da68a11
commit 2e859794ee
No known key found for this signature in database
GPG key ID: 022896A53AEF1381

View file

@ -65,9 +65,7 @@ def filter(%{"object" => %{"emoji" => foreign_emojis, "actor" => actor}} = messa
Path.join(Config.get([:instance, :static_dir]), "emoji/stolen")
)
if not Config.get([:mrf_steal_emoji, :dir_exists?], false) do
create_dir(emoji_dir_path)
end
File.mkdir_p(emoji_dir_path)
new_emojis =
foreign_emojis
@ -98,12 +96,4 @@ def filter(message), do: {:ok, message}
def describe do
{:ok, %{}}
end
defp create_dir(path) do
if not File.exists?(path) do
File.mkdir_p!(path)
end
Config.put([:mrf_steal_emoji, :dir_exists?], true)
end
end