mirror of
https://github.com/iptv-org/api.git
synced 2025-05-12 10:00:07 -04:00
Delete update.js
This commit is contained in:
parent
f387f50003
commit
298e3e74fe
1 changed files with 0 additions and 23 deletions
|
@ -1,23 +0,0 @@
|
|||
const { csv } = require('./core')
|
||||
const path = require('path')
|
||||
const glob = require('glob')
|
||||
const fs = require('fs')
|
||||
|
||||
const DATABASE_DIR = './database'
|
||||
const OUTPUT_DIR = './.gh-pages'
|
||||
|
||||
fs.exists(OUTPUT_DIR, function (exists) {
|
||||
if (!exists) {
|
||||
fs.mkdirSync(OUTPUT_DIR)
|
||||
}
|
||||
})
|
||||
|
||||
glob(`${DATABASE_DIR}/*.csv`, async function (err, files) {
|
||||
for (const inputFile of files) {
|
||||
const inputFilename = path.parse(inputFile).name
|
||||
const outputFile = `${OUTPUT_DIR}/${inputFilename}.json`
|
||||
|
||||
const json = await csv.load(inputFile)
|
||||
fs.writeFileSync(path.resolve(outputFile), JSON.stringify(json))
|
||||
}
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue