chore(dotnet): fix generator escaping, make script lf-friendly (#6606)
This commit is contained in:
parent
fd1e62b8c5
commit
333397c0e8
|
|
@ -204,6 +204,15 @@ const customTypeNames = new Map([
|
||||||
if (process.argv[3] !== "--skip-format") {
|
if (process.argv[3] !== "--skip-format") {
|
||||||
// run the formatting tool for .net, to ensure the files are prepped
|
// run the formatting tool for .net, to ensure the files are prepped
|
||||||
execSync(`dotnet format -f "${typesDir}" --include-generated --fix-whitespace`);
|
execSync(`dotnet format -f "${typesDir}" --include-generated --fix-whitespace`);
|
||||||
|
if (process.platform !== 'win32') {
|
||||||
|
for (const folder of [typesDir, path.join(typesDir, 'Models'), path.join(typesDir, 'Enums'), path.join(typesDir, 'Extensions'), path.join(typesDir, 'Constants')])
|
||||||
|
for (const name of fs.readdirSync(folder)) {
|
||||||
|
if (!name.includes('\.cs'))
|
||||||
|
continue;
|
||||||
|
const content = fs.readFileSync(path.join(folder, name), 'utf-8');
|
||||||
|
fs.writeFileSync(path.join(folder, name), content.split('\r\n').join('\n'));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ function _wrapCode(lines) {
|
||||||
let i = 0;
|
let i = 0;
|
||||||
let out = [];
|
let out = [];
|
||||||
for (let line of lines) {
|
for (let line of lines) {
|
||||||
line = line.replace('<', '<').replace('>', '>');
|
line = line.replace(/[&]/g, '&').replace(/</g, '<').replace(/>/g, '>');
|
||||||
if (i < lines.length - 1)
|
if (i < lines.length - 1)
|
||||||
line = line + "<br/>";
|
line = line + "<br/>";
|
||||||
out.push(line);
|
out.push(line);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue