From 3a21a26f6b684caa63f3cdf2a632adf1487dc9c7 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Thu, 27 Oct 2022 05:39:45 +0300 Subject: [PATCH] Update update.js --- scripts/commands/readme/update.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/commands/readme/update.js b/scripts/commands/readme/update.js index dc1fbd3e..e70f7f30 100644 --- a/scripts/commands/readme/update.js +++ b/scripts/commands/readme/update.js @@ -12,8 +12,8 @@ const options = program async function main() { await api.countries.load().catch(console.error) const logPath = `${LOGS_DIR}/guides/update.log` - const results = await parser.parseLogs(logPath) - const files = results.reduce((acc, curr) => { + let results = await parser.parseLogs(logPath) + let files = results.reduce((acc, curr) => { if (acc[curr.filename]) { acc[curr.filename].channels++ } else { @@ -41,7 +41,11 @@ async function main() { ]) } - data = _.orderBy(data, [item => item[0], item => item[2]], ['asc', 'desc']) + data = _.orderBy( + data, + [item => item[0], item => (item[3].includes('_en') ? Infinity : item[2])], + ['asc', 'desc'] + ) data = data.map(i => { i.shift() return i