Make sure emitted d.ts files are LF, not CRLF (#55407)

This commit is contained in:
Jake Bailey
2023-08-16 16:42:56 -07:00
committed by GitHub
parent 1488256ec4
commit b5557271a5

View File

@@ -417,7 +417,7 @@ const dprintPath = path.resolve(__dirname, "..", "node_modules", "dprint", "bin.
* @returns {string}
*/
function dprint(contents) {
return cp.execFileSync(
const result = cp.execFileSync(
process.execPath,
[dprintPath, "fmt", "--stdin", "ts"],
{
@@ -427,6 +427,7 @@ function dprint(contents) {
maxBuffer: 100 * 1024 * 1024, // 100 MB "ought to be enough for anyone"; https://github.com/nodejs/node/issues/9829
},
);
return result.replace(/\r\n/g, "\n");
}
fs.writeFileSync(output, dprint(publicContents));