diff --git a/build/emoji.js b/build/emoji.js index 0dc41dc3b..d8cc5353e 100644 --- a/build/emoji.js +++ b/build/emoji.js @@ -42,7 +42,8 @@ function writeEmojiPage(emojiData) { const emojiPage = (isExistingPage && fs.readFileSync(filePaths.emojiMarkdown, 'utf8')) || `\n\n`; - const emojiRegEx = /(\n)([\s\S]*)(\n)/; + const emojiRegEx = /(\r?\n)([\s\S]*)(\r?\n)/; + // ^ Note, we use \r? in case Windows converts to CRLF const emojiMatch = emojiPage.match(emojiRegEx); const emojiMarkdownStart = emojiMatch[1].trim(); const emojiMarkdown = emojiMatch[2].trim(); @@ -95,13 +96,9 @@ function writeEmojiJS(emojiData) { console.info('Build emoji'); -try { - const emojiData = await getEmojiData(); +const emojiData = await getEmojiData(); - if (emojiData) { - writeEmojiPage(emojiData); - writeEmojiJS(emojiData); - } -} catch (err) { - console.warn(`- Error: ${err.message}`); +if (emojiData) { + writeEmojiPage(emojiData); + writeEmojiJS(emojiData); }