devops: switch to LF line-endings in Git for text files (#10292)

Co-authored-by: Max Schmitt <max@schmitt.mx>
This commit is contained in:
Andrey Lushnikov 2021-11-15 08:48:49 -08:00 committed by GitHub
parent 1c9c0dc2e6
commit fd3ec50cf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

4
.gitattributes vendored
View File

@ -1,3 +1,3 @@
# text files must be lf for golden file tests to work
*.txt eol=lf
*.json eol=lf
* text=auto eol=lf

View File

@ -294,8 +294,6 @@ validator_ts.push(`
let hasChanges = false;
function writeFile(filePath, content) {
if (os.platform() === 'win32')
content = content.replace(/\r\n/g, '\n').replace(/\n/g, '\r\n');
const existing = fs.readFileSync(filePath, 'utf8');
if (existing === content)
return;