diff options
author | rinpatch <rinpatch@sdf.org> | 2019-10-19 08:51:03 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-10-19 08:51:03 +0000 |
commit | fd6d05dc45e2fdff56e777431b303fc24ef7912f (patch) | |
tree | bf849590a8a556f08e9fc864df1410d050821049 | |
parent | 5c6c3026ea7bd20cb2c10f6e2e34a54734d2509e (diff) | |
parent | fbe5a00475331962d7112ed5a0d5cf8bb5bf3ece (diff) | |
download | pleroma-fd6d05dc45e2fdff56e777431b303fc24ef7912f.tar.gz |
Merge branch 'mix-emoji-task-pack-json' into 'develop'
For pleroma.emoji downloaded packs, generate pack.json instead
See merge request pleroma/pleroma!1748
-rw-r--r-- | lib/mix/tasks/pleroma/emoji.ex | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/mix/tasks/pleroma/emoji.ex b/lib/mix/tasks/pleroma/emoji.ex index 6ef0a635d..35669af27 100644 --- a/lib/mix/tasks/pleroma/emoji.ex +++ b/lib/mix/tasks/pleroma/emoji.ex @@ -111,19 +111,21 @@ defmodule Mix.Tasks.Pleroma.Emoji do file_list: files_to_unzip ) - IO.puts(IO.ANSI.format(["Writing emoji.txt for ", :bright, pack_name])) - - emoji_txt_str = - Enum.map( - files, - fn {shortcode, path} -> - emojo_path = Path.join("/emoji/#{pack_name}", path) - "#{shortcode}, #{emojo_path}" - end - ) - |> Enum.join("\n") - - File.write!(Path.join(pack_path, "emoji.txt"), emoji_txt_str) + IO.puts(IO.ANSI.format(["Writing pack.json for ", :bright, pack_name])) + + pack_json = %{ + pack: %{ + "license" => pack["license"], + "homepage" => pack["homepage"], + "description" => pack["description"], + "fallback-src" => pack["src"], + "fallback-src-sha256" => pack["src_sha256"], + "share-files" => true + }, + files: files + } + + File.write!(Path.join(pack_path, "pack.json"), Jason.encode!(pack_json, pretty: true)) else IO.puts(IO.ANSI.format([:bright, :red, "No pack named \"#{pack_name}\" found"])) end |