mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update channels.js
This commit is contained in:
parent
4aa2446fdf
commit
cf5c9b2e1c
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue