Move ingestion scripts to ingest
This commit is contained in:
1
ingest/data.json
Normal file
1
ingest/data.json
Normal file
File diff suppressed because one or more lines are too long
@@ -1,5 +1,6 @@
|
||||
const data = require("./data.json")
|
||||
const fs = require("fs")
|
||||
import fs from "fs"
|
||||
|
||||
const data = JSON.parse(fs.readFileSync("data.json", "utf8"))
|
||||
|
||||
const dataPerRegion = {}
|
||||
|
||||
@@ -15,7 +16,7 @@ for (const item of data) {
|
||||
|
||||
for (const region in dataPerRegion) {
|
||||
const sanitizedRegion = region.replaceAll(" ", "_").replaceAll("-", "_")
|
||||
const regionFile = `public/${sanitizedRegion}.json`
|
||||
const regionFile = `../public/${sanitizedRegion}.json`
|
||||
console.log("Writing to", regionFile)
|
||||
fs.writeFileSync(regionFile, JSON.stringify(dataPerRegion[region], null, 2))
|
||||
}
|
||||
BIN
ingest/static.db
Normal file
BIN
ingest/static.db
Normal file
Binary file not shown.
Reference in New Issue
Block a user