mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2025-10-28 20:45:35 -05:00
v1.209.0
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
import * as fs from "fs";
|
||||
import fs from "fs";
|
||||
import {Command} from "commander";
|
||||
import "../js/parser.js";
|
||||
import "../js/utils.js";
|
||||
import "../js/utils-ui.js";
|
||||
import "../js/render.js";
|
||||
import "../js/render-dice.js";
|
||||
import "../js/hist.js";
|
||||
import "../js/filter.js";
|
||||
import "../js/utils-brew.js";
|
||||
import * as utS from "./util-search-index.js";
|
||||
import {Timer} from "./util.js";
|
||||
|
||||
const program = new Command()
|
||||
.option("--partnered", `If the partnered content index is to be generated.`)
|
||||
;
|
||||
|
||||
program.parse(process.argv);
|
||||
const params = program.opts();
|
||||
|
||||
async function main () {
|
||||
const t = Timer.start();
|
||||
|
||||
console.log("##### Creating primary index... #####");
|
||||
const index = await utS.UtilSearchIndex.pGetIndex();
|
||||
fs.writeFileSync("search/index.json", JSON.stringify(index), "utf8");
|
||||
@@ -21,6 +33,13 @@ async function main () {
|
||||
console.log("##### Creating Foundry index... #####");
|
||||
const indexFoundry = await utS.UtilSearchIndex.pGetIndexFoundry();
|
||||
fs.writeFileSync("search/index-foundry.json", JSON.stringify(indexFoundry), "utf8");
|
||||
|
||||
if (params.partnered) {
|
||||
console.log("##### Creating partnered content index... #####");
|
||||
const indexPartnered = await utS.UtilSearchIndex.pGetIndexPartnered();
|
||||
fs.writeFileSync("search/index-partnered.json", JSON.stringify(indexPartnered), "utf8");
|
||||
}
|
||||
|
||||
console.log(`Created indexes in ${Timer.stop(t)}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user