mirror of
https://github.com/iptv-org/epg
synced 2025-12-18 11:27:06 -05:00
Update update-readme.js
This commit is contained in:
@@ -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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user