From 8649ff8b7c8d9ff163bfaaa62802c761bff9bc17 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Wed, 11 May 2022 15:46:07 +0300 Subject: [PATCH] Update update.js --- scripts/commands/api/update.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/commands/api/update.js b/scripts/commands/api/update.js index d69e26ce..0b925643 100644 --- a/scripts/commands/api/update.js +++ b/scripts/commands/api/update.js @@ -8,9 +8,9 @@ const OUTPUT_DIR = process.env.OUTPUT_DIR || '.api' async function main() { let guides = [] - try { - const files = await file.list(CHANNELS_PATH) - for (const filepath of files) { + const files = await file.list(CHANNELS_PATH).catch(console.error) + for (const filepath of files) { + try { const { site, channels } = await parser.parseChannels(filepath) const dir = file.dirname(filepath) const config = require(file.resolve(`${dir}/${site}.config.js`)) @@ -27,9 +27,10 @@ async function main() { url: `https://iptv-org.github.io/epg/guides/${suffix}/${site}.epg.xml` }) } + } catch (err) { + console.error(err) + continue } - } catch (err) { - console.error(err) } guides = _.sortBy(guides, 'channel')