mirror of
https://github.com/iptv-org/database.git
synced 2024-11-09 22:16:38 -05:00
Update validate.js
This commit is contained in:
parent
9341dc78b7
commit
282cb42185
1 changed files with 10 additions and 6 deletions
|
@ -34,20 +34,24 @@ async function main() {
|
|||
process.exit(1)
|
||||
}
|
||||
|
||||
const data = await csv.fromString(csvString).catch(err => {
|
||||
logger.error(chalk.red(`\n${err.message} (${filepath})`))
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
const filename = file.getFilename(filepath)
|
||||
|
||||
if (!schemes[filename]) {
|
||||
logger.error(chalk.red(`\nError: "${filename}" scheme is missing`))
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const data = await csv.fromString(csvString).catch(err => {
|
||||
logger.error(chalk.red(`\n${err.message} (${filepath})`))
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
let fileErrors = []
|
||||
if (filename === 'channels') {
|
||||
if (/\"/.test(csvString)) {
|
||||
logger.error(chalk.red(`\nError: \" character is not allowed (${filepath})`))
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
fileErrors = fileErrors.concat(findDuplicatesById(data))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue