Treat the manifest path as a file if it doesn't start with http
authorEkaterina Vaartis <vaartis@cock.li>
Thu, 18 Apr 2019 17:06:59 +0000 (20:06 +0300)
committerEkaterina Vaartis <vaartis@cock.li>
Sat, 20 Apr 2019 08:17:17 +0000 (11:17 +0300)
lib/mix/tasks/pleroma/emoji.ex

index fed3dcb405abf304c3ae2d2ed3ee36f86aeb2971..9cb6fb88dddab1a58bf00823884bfafa3f486f44 100644 (file)
@@ -231,7 +231,13 @@ defmodule Mix.Tasks.Pleroma.Emoji do
   end
 
   defp fetch_manifest(from) do
-    Tesla.get!(from).body |> Poison.decode!()
+    Poison.decode!(
+      if String.starts_with?(from, "http") do
+        Tesla.get!(from).body
+      else
+        File.read!(from)
+      end
+    )
   end
 
   defp parse_global_opts(args) do