Update create-matrix.js

This commit is contained in:
Aleksandr Statciuk 2021-10-13 19:56:46 +03:00
parent 5bd84efe5d
commit 1d013713e6

View file

@ -1,12 +1,16 @@
const { Command } = require('commander')
const file = require('./file')
const parser = require('./parser')
file
.list('sites/*.channels.xml', [
'sites/andorradifusio.ad.channels.xml',
'sites/arianaafgtv.com.channels.xml'
])
.then(files => {
const program = new Command()
program
.option('--include <include>', 'List of files to include', parseList)
.option('--exclude <exclude>', 'List of files to exclude', parseList)
.parse(process.argv)
const options = program.opts()
file.list('sites/*.channels.xml', options.include, options.exclude).then(files => {
const matrix = {
guide: []
}
@ -24,4 +28,10 @@ file
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
console.log(output)
})
})
function parseList(str) {
if (!str) return []
return str.split(',')
}