emoji: Move zulip-emoji to `images/emoji/unicode`.

Move zulip-emoji from its current location `images/emoji` to
`images/emoji/unicode` and add a symlink in `images/emoji`
to zulip.png in `images/emoji/unicode`.
This commit is contained in:
Harshit Bansal 2017-02-07 22:34:39 +00:00 committed by Tim Abbott
parent be57d49beb
commit bc4aef0bc7
1 changed files with 12 additions and 1 deletions

View File

@ -219,12 +219,23 @@ def dump_emojis(cache_path):
shell=True)
cache_emoji = os.path.join(cache_path, 'images', 'emoji')
cache_emoji_unicode = os.path.join(cache_path, 'images', 'emoji', 'unicode')
run(['rm', '-rf', cache_path])
run(['mkdir', '-p', cache_emoji])
run(['mv', 'out/*', cache_emoji], shell=True)
run(['mv', 'sprite*', cache_path], shell=True)
assets = "{}/static/assets/zulip-emoji/*".format(ZULIP_PATH)
run(['cp', '-RPp', assets, cache_emoji], shell=True)
run(['cp', '-RPp', assets, cache_emoji_unicode], shell=True)
for fn in [os.path.basename(file_name) for file_name in glob.glob(assets)]:
os.symlink(
os.path.join(cache_emoji_unicode, fn),
os.path.join(cache_emoji, fn)
)
# Add zulip emoji to `emoji_map` so that we can avoid
# adding unnecessary exceptions to the rendering logic.
emoji_map['zulip'] = 'zulip'
EMOJI_CODES_PATH = os.path.join(cache_path, 'emoji_codes.js')
emoji_codes_file = open(EMOJI_CODES_PATH, 'w')