Change YAML to JSON
This commit is contained in:
parent
b0ecd412f5
commit
2a94eca096
9 changed files with 58 additions and 54 deletions
|
|
@ -146,12 +146,12 @@ defmodule Pleroma.Emoji do
|
|||
defp load_pack(pack_dir, emoji_groups) do
|
||||
pack_name = Path.basename(pack_dir)
|
||||
|
||||
pack_yaml = Path.join(pack_dir, "pack.yml")
|
||||
pack_file = Path.join(pack_dir, "pack.json")
|
||||
|
||||
if File.exists?(pack_yaml) do
|
||||
yaml = RelaxYaml.Decoder.read_from_file(pack_yaml)
|
||||
if File.exists?(pack_file) do
|
||||
contents = Jason.decode!(File.read!(pack_file))
|
||||
|
||||
yaml["files"]
|
||||
contents["files"]
|
||||
|> Enum.map(fn {name, rel_file} ->
|
||||
filename = Path.join("/emoji/#{pack_name}", rel_file)
|
||||
{name, filename, pack_name}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue