From faaa83c3ce0ff8396f1f4a0eab97dad1a3a6598f Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Thu, 28 Oct 2021 22:57:59 +0300 Subject: [PATCH] Update create-matrix.js --- scripts/create-matrix.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/create-matrix.js b/scripts/create-matrix.js index 7b181a94..897919de 100644 --- a/scripts/create-matrix.js +++ b/scripts/create-matrix.js @@ -1,6 +1,5 @@ const { Command } = require('commander') const file = require('./file') -const grabber = require('epg-grabber') const program = new Command() program @@ -16,14 +15,9 @@ file.list('sites/*/*.channels.xml', options.include, options.exclude).then(files } files.forEach(filename => { - const country = filename.match(/sites\/.*\/.*_(.*)\.channels\.xml/i)[1] + const [_, site, country] = filename.match(/sites\/.*\/(.*)_(.*)\.channels\.xml/i) - const channelsFile = file.read(filename) - const parsed = grabber.parseChannels(channelsFile) - matrix.guide.push({ - site: parsed.site, - country - }) + matrix.guide.push({ site, country }) }) const output = `::set-output name=matrix::${JSON.stringify(matrix)}`