Files
anatomia/data-pipeline/scripts/merge-manifests.mjs
T

21 lines
1.1 KiB
JavaScript

import { readFileSync, writeFileSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const SEED_DIR = path.resolve(__dirname, "../seed");
const real = JSON.parse(readFileSync(path.join(SEED_DIR, "manifest-real.json"), "utf-8"));
const tegumentar = JSON.parse(readFileSync(path.join(SEED_DIR, "manifest-tegumentar.json"), "utf-8"));
const microscopy = JSON.parse(readFileSync(path.join(SEED_DIR, "manifest-microscopy.json"), "utf-8"));
const cell = JSON.parse(readFileSync(path.join(SEED_DIR, "manifest-cell.json"), "utf-8"));
const structures = [...real.structures, ...tegumentar.structures, ...microscopy.structures, ...cell.structures];
writeFileSync(
path.join(SEED_DIR, "manifest.json"),
JSON.stringify({ structures }, null, 2),
);
console.log(`manifest.json final: ${structures.length} estruturas (${real.structures.length} reais + ${tegumentar.structures.length} tegumentar + ${microscopy.structures.length} histologia + ${cell.structures.length} citologia).`);