From bad2b1d7ed118e5bbdfdb46c62b51cb09366d7c0 Mon Sep 17 00:00:00 2001 From: Jeany Date: Thu, 15 Oct 2026 23:55:16 -0600 Subject: [PATCH] build:map writes the log whole to EUDPLIB_LOG_FILE The script exits as soon as the map is written, and what is still on its way down a pipe is lost; a log of megabytes (TrigScript's map of triggers) came out cut short. EUDPLIB_LOG_FILE= writes it to a file instead. Co-Authored-By: Claude Opus 5.5 --- scripts/build-map.mts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/build-map.mts b/scripts/build-map.mts index 904d357..b300246 100644 --- a/scripts/build-map.mts +++ b/scripts/build-map.mts @@ -6,6 +6,8 @@ * `/work/files/` from a plugin setting). * * npm run build:map -- [name=plugin.py ...] [file=name=path ...] + * + * EUDPLIB_LOG=1 prints eudplib's log; EUDPLIB_LOG_FILE= writes it to a file (whole, however long). */ import { readFileSync, writeFileSync } from "node:fs"; import { createRequire } from "node:module"; @@ -52,6 +54,8 @@ try { writeFileSync(outPath, out.map); console.log(`${outPath}: ${out.map.length} bytes, ${countTriggers((await splitMap(out.map)).chk)} triggers`); if (process.env.EUDPLIB_LOG) console.log(lines.join("\n")); + // (A file for a log of megabytes: what is still on its way down a pipe is lost at process.exit.) + if (process.env.EUDPLIB_LOG_FILE) writeFileSync(process.env.EUDPLIB_LOG_FILE, lines.join("\n")); } catch (err) { console.error(`build failed: ${(err as Error).message}\n${lines.join("\n")}`); process.exit(1);