uploader.ts 592 B

12345678910111213141516171819202122232425262728
  1. import { config } from "./config";
  2. import fs from "fs";
  3. import path from "path";
  4. export async function uploadTargets() {
  5. for (const target of config.targets) {
  6. console.log({ target });
  7. for (const target of config.targets.sort()) {
  8. const raw = JSON.parse(
  9. fs.readFileSync(path.join(__dirname, "raw", `${target}.json`))
  10. );
  11. for (const entry of raw) {
  12. try {
  13. console.log(entry);
  14. } catch (err) {
  15. console.error(err);
  16. }
  17. }
  18. }
  19. }
  20. }
  21. async function run() {
  22. await uploadTargets();
  23. }
  24. run().catch(console.log);