Update index.js
This commit is contained in:
parent
bbc4709dd4
commit
134a727824
11
src/index.js
11
src/index.js
|
@ -3,11 +3,12 @@
|
||||||
const { Command } = require('commander')
|
const { Command } = require('commander')
|
||||||
const program = new Command()
|
const program = new Command()
|
||||||
const utils = require('./utils')
|
const utils = require('./utils')
|
||||||
|
const { name, version, description } = require('../package.json')
|
||||||
|
|
||||||
program
|
program
|
||||||
.version('0.1.0', '-v, --version')
|
.name(name)
|
||||||
.name('epg-grabber')
|
.version(version, '-v, --version')
|
||||||
.description('EPG grabber')
|
.description(description)
|
||||||
.option('-c, --config <config>', 'Path to [site].config.js file')
|
.option('-c, --config <config>', 'Path to [site].config.js file')
|
||||||
.option('-d, --debug', 'Enable debug mode')
|
.option('-d, --debug', 'Enable debug mode')
|
||||||
.parse(process.argv)
|
.parse(process.argv)
|
||||||
|
@ -37,7 +38,9 @@ async function main() {
|
||||||
const progs = await client
|
const progs = await client
|
||||||
.get(url)
|
.get(url)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
const parserOptions = Object.assign({}, item, config, { content: response.data })
|
const parserOptions = Object.assign({}, item, config, {
|
||||||
|
content: response.data
|
||||||
|
})
|
||||||
const programs = config
|
const programs = config
|
||||||
.parser(parserOptions)
|
.parser(parserOptions)
|
||||||
.filter(i => i)
|
.filter(i => i)
|
||||||
|
|
Loading…
Reference in New Issue