mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Update update-readme.js
This commit is contained in:
parent
a4d2717a6e
commit
e6ff94625c
1 changed files with 7 additions and 7 deletions
|
@ -5,11 +5,11 @@ const provinces = require('../data/ca-provinces.json')
|
||||||
const { program } = require('commander')
|
const { program } = require('commander')
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
|
|
||||||
let log = []
|
|
||||||
|
|
||||||
const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs'
|
const LOGS_DIR = process.env.LOGS_DIR || 'scripts/logs'
|
||||||
const LOG_PATH = `${LOGS_DIR}/update-guides.log`
|
const LOG_PATH = `${LOGS_DIR}/update-guides.log`
|
||||||
|
|
||||||
|
let log = []
|
||||||
|
|
||||||
const options = program
|
const options = program
|
||||||
.option('-c, --config <config>', 'Set path to config file', '.readme/config.json')
|
.option('-c, --config <config>', 'Set path to config file', '.readme/config.json')
|
||||||
.parse(process.argv)
|
.parse(process.argv)
|
||||||
|
@ -18,11 +18,6 @@ const options = program
|
||||||
async function main() {
|
async function main() {
|
||||||
await setUp()
|
await setUp()
|
||||||
|
|
||||||
if (!log.length) {
|
|
||||||
logger.error(`File "${LOG_PATH}" is empty`)
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
await generateCountriesTable()
|
await generateCountriesTable()
|
||||||
await generateUSStatesTable()
|
await generateUSStatesTable()
|
||||||
await generateCanadaProvincesTable()
|
await generateCanadaProvincesTable()
|
||||||
|
@ -114,4 +109,9 @@ async function updateReadme() {
|
||||||
|
|
||||||
async function setUp() {
|
async function setUp() {
|
||||||
log = await parser.parseLogs(LOG_PATH)
|
log = await parser.parseLogs(LOG_PATH)
|
||||||
|
|
||||||
|
if (!log.length) {
|
||||||
|
logger.error(`File "${LOG_PATH}" is empty`)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue