Block registry api
This commit is contained in:
@@ -95,8 +95,8 @@ async function build_assets() {
|
||||
|
||||
// every mod in mods/, checked and sorted so dependencies load first. a broken mod fails the whole build,
|
||||
// the game never runs with some mods missing
|
||||
function load_mods(): LoadedMod[] {
|
||||
const mods = load_and_check(MODS_FOLDER);
|
||||
async function load_mods(): Promise<LoadedMod[]> {
|
||||
const mods = await load_and_check(MODS_FOLDER);
|
||||
const problems = mods.flatMap((mod) => mod.report.errors.map((error) => ` ${mod.id}: ${error}`));
|
||||
if (problems.length > 0) {
|
||||
throw new Error(`Mods have errors (deno task check-mods for details):\n${problems.join("\n")}`);
|
||||
@@ -154,7 +154,7 @@ async function build() {
|
||||
const now = performance.now();
|
||||
clear_folder(BUILD_FOLDER);
|
||||
// checked first: a mod with errors stops the build before any .cubi is written
|
||||
const mods = load_mods();
|
||||
const mods = await load_mods();
|
||||
await build_assets();
|
||||
await build_client();
|
||||
await write_client_manifest(BUILD_FOLDER);
|
||||
|
||||
Reference in New Issue
Block a user