build_emoji: Add nice error message for symlink errors.

This commit is contained in:
Christie Koehler 2016-11-03 12:36:56 -07:00 committed by Tim Abbott
parent 2488698430
commit 391ff638d5
1 changed files with 17 additions and 5 deletions

View File

@ -115,7 +115,13 @@ def main():
print("Using cached emojis from {}".format(source_emoji_dump))
run(['rm', '-rf', TARGET_EMOJI_DUMP])
run(['ln', '-nsf', source_emoji_dump, TARGET_EMOJI_DUMP])
try:
os.symlink(
source_emoji_dump,
TARGET_EMOJI_DUMP
)
except OSError:
print("Error: Unable to create symlinks. Make sure you have permission to create symbolic links.")
def get_success_stamp():
# type: () -> str
@ -168,10 +174,16 @@ def dump_emojis(cache_path):
failed = True
continue
try:
os.symlink(
'unicode/{}.png'.format(code_point),
'out/{}.png'.format(name)
)
except OSError:
print("Error: Unable to create symlinks. Make sure you have permission to create symbolic links.")
failed = True
# probably should not try to create additional links
break
if failed:
print("Errors dumping emoji!")