mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update create-matrix.js
This commit is contained in:
parent
5bd84efe5d
commit
1d013713e6
1 changed files with 30 additions and 20 deletions
|
@ -1,12 +1,16 @@
|
||||||
|
const { Command } = require('commander')
|
||||||
const file = require('./file')
|
const file = require('./file')
|
||||||
const parser = require('./parser')
|
const parser = require('./parser')
|
||||||
|
|
||||||
file
|
const program = new Command()
|
||||||
.list('sites/*.channels.xml', [
|
program
|
||||||
'sites/andorradifusio.ad.channels.xml',
|
.option('--include <include>', 'List of files to include', parseList)
|
||||||
'sites/arianaafgtv.com.channels.xml'
|
.option('--exclude <exclude>', 'List of files to exclude', parseList)
|
||||||
])
|
.parse(process.argv)
|
||||||
.then(files => {
|
|
||||||
|
const options = program.opts()
|
||||||
|
|
||||||
|
file.list('sites/*.channels.xml', options.include, options.exclude).then(files => {
|
||||||
const matrix = {
|
const matrix = {
|
||||||
guide: []
|
guide: []
|
||||||
}
|
}
|
||||||
|
@ -25,3 +29,9 @@ file
|
||||||
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
|
const output = `::set-output name=matrix::${JSON.stringify(matrix)}`
|
||||||
console.log(output)
|
console.log(output)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function parseList(str) {
|
||||||
|
if (!str) return []
|
||||||
|
|
||||||
|
return str.split(',')
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue