Commit 739d454f authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

DDI repair: Uncomment & improve filtering of INED DDI files to keep.

parent 73ded7e1
......@@ -102,21 +102,22 @@ async function main() {
}
const { source: sourceDir, target: targetDir } = options
await fs.remove(targetDir)
await fs.ensureDir(targetDir)
/*
const inedtxtfile: string = await fs.readFile(path.join("../../public_data", "ined-liste-ddi.txt"), {
encoding: "utf8",
})
const inedListe = inedtxtfile.split('\n')
*/
const inedIdsText: string = await fs.readFile(
path.join(sourceDir, "..", "ined-liste-ddi.txt"),
{
encoding: "utf8",
},
)
const inedIds = inedIdsText.split("\n").map((id) => id.trim())
for (const filename of await fs.readdir(sourceDir)) {
if (!filename.endsWith(".xml") /*&& inedListe.includes(filename.split(".")[0])*/) {
if (
!filename.endsWith(".xml") ||
!inedIds.includes(filename.split(".")[0]!)
) {
continue
}
const xml: string = await fs.readFile(path.join(sourceDir, filename), {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment