Skip to content

Commit 65e5f80

Browse files
committed
ci: inspect runtime boundaries independent of checkout EOL
1 parent 0076182 commit 65e5f80

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎scripts/check-runtime-boundary.mjs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFile, readdir } from "node:fs/promises";
1+
import { readFile as readRawFile, readdir } from "node:fs/promises";
22
import { dirname, join, relative, resolve } from "node:path";
33
import { fileURLToPath } from "node:url";
44
import {
@@ -1992,6 +1992,14 @@ async function sourceFiles(directory) {
19921992
return files.sort();
19931993
}
19941994

1995+
async function readFile(path, encoding) {
1996+
const source = await readRawFile(path, encoding);
1997+
// This gate inspects source contracts, not a checkout's native line-ending
1998+
// convention. Normalize before matching multiline runtime templates so the
1999+
// same committed source answers identically on Windows, macOS, and Linux.
2000+
return typeof source === "string" ? source.replace(/\r\n?/gu, "\n") : source;
2001+
}
2002+
19952003
function escapeRegex(value) {
19962004
return value.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
19972005
}

0 commit comments

Comments
 (0)