fix build script ignoring last lines

This commit is contained in:
2026-05-01 15:08:22 +02:00
parent 42ea545507
commit e90e792ebf

View File

@@ -78,6 +78,8 @@ class Minifier {
flush: (controller) => { flush: (controller) => {
this.buffer += "\n"; this.buffer += "\n";
controller.enqueue(this.processChunk()); controller.enqueue(this.processChunk());
controller.enqueue(this.lines.join("\n") + "\n");
this.lines = [];
}, },
}); });
@@ -139,7 +141,7 @@ async function build(output: WritableStreamDefaultWriter<string>) {
const readable = file.readable.pipeThrough(new TextDecoderStream()) const readable = file.readable.pipeThrough(new TextDecoderStream())
.pipeThrough(new TextLineStream()); .pipeThrough(new TextLineStream());
output.write(` await output.write(`
;/******************************* ;/*******************************
;* ${path} ;* ${path}
;*******************************/ ;*******************************/
@@ -147,7 +149,7 @@ async function build(output: WritableStreamDefaultWriter<string>) {
for await (const line of readable) { for await (const line of readable) {
if (!line.startsWith("include ")) { if (!line.startsWith("include ")) {
output.write(`${line}\n`); await output.write(`${line}\n`);
} }
} }
} }
@@ -166,15 +168,16 @@ async function build(output: WritableStreamDefaultWriter<string>) {
); );
} }
output.write(asmRawRepresentations.join("\n\n")); await output.write(asmRawRepresentations.join("\n\n"));
output.write(` await output.write(`
; ;
; RESERVED RAM SPACE ; RESERVED RAM SPACE
; ;
`); `);
output.write(await Deno.readTextFile(reservedSpacePath)); await output.write(await Deno.readTextFile(reservedSpacePath));
await output.close();
} }
/** /**