mirror of
https://github.com/iptv-org/epg
synced 2025-12-18 11:27:06 -05:00
Update channels.js
This commit is contained in:
@@ -6,6 +6,7 @@ const { json2xml } = require('./utils')
|
|||||||
const program = new Command()
|
const program = new Command()
|
||||||
program
|
program
|
||||||
.requiredOption('-c, --config <config>', 'Config file')
|
.requiredOption('-c, --config <config>', 'Config file')
|
||||||
|
.option('-s, --set [args...]', 'Set custom arguments')
|
||||||
.option('-o, --output <output>', 'Output file')
|
.option('-o, --output <output>', 'Output file')
|
||||||
.parse(process.argv)
|
.parse(process.argv)
|
||||||
|
|
||||||
@@ -13,7 +14,12 @@ const options = program.opts()
|
|||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
const config = require(path.resolve(options.config))
|
const config = require(path.resolve(options.config))
|
||||||
let channels = config.channels()
|
const args = {}
|
||||||
|
options.set.forEach(arg => {
|
||||||
|
const [key, value] = arg.split(':')
|
||||||
|
args[key] = value
|
||||||
|
})
|
||||||
|
let channels = config.channels(args)
|
||||||
if (isPromise(channels)) {
|
if (isPromise(channels)) {
|
||||||
channels = await channels
|
channels = await channels
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user