From bf3decfd0cc7fdc39c203dbd5fcf28614a05d64e Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Fri, 17 Apr 2020 12:00:18 +0000 Subject: [PATCH] build_emoji: Inline get_success_stamp. So, `source_emoji_dump` is not the greatest variable name, but at least we now define it relative to its parent instead of the `.success-stamp` file. (And then `success_stamp` is just another join.) --- tools/setup/emoji/build_emoji | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/setup/emoji/build_emoji b/tools/setup/emoji/build_emoji index 8950336553..9b736a41ab 100755 --- a/tools/setup/emoji/build_emoji +++ b/tools/setup/emoji/build_emoji @@ -77,8 +77,9 @@ if 'TRAVIS' in os.environ: EMOJI_CACHE_PATH = "/home/travis/zulip-emoji-cache" def main() -> None: - success_stamp = get_success_stamp() - source_emoji_dump = os.path.dirname(success_stamp) + sha1_hexdigest = generate_sha1sum_emoji(ZULIP_PATH) + source_emoji_dump = os.path.join(EMOJI_CACHE_PATH, sha1_hexdigest, 'emoji') + success_stamp = os.path.join(source_emoji_dump, '.success-stamp') if not os.path.exists(success_stamp): print("Dumping emojis ...") @@ -101,10 +102,6 @@ def main() -> None: for filename in to_remove: os.remove(os.path.join(TARGET_EMOJI_STYLES, filename)) -def get_success_stamp() -> str: - sha1_hexdigest = generate_sha1sum_emoji(ZULIP_PATH) - return os.path.join(EMOJI_CACHE_PATH, sha1_hexdigest, 'emoji', '.success-stamp') - def percent(f: float) -> str: return '%0.3f%%' % (f * 100,)