Open Cosifne opened 1 year ago
I'm using JSON.stringify to turn the bundle object into a string: https://github.com/microsoft/vscode-l10n/blob/main/l10n-dev/src/cli.ts#L181
it turns out there isn't a way to say "I want the lines to end in CRLF" within JSON.stringify
... so the only solution is to do something prettty hacky by post processing. We run the risk of turning actual expected usages of LF's into CLRF's which does concern me.
Alternatives:
Configuring git to allow LF
files would workaround this warning:
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings
The other question I have is... why check in a file that's entirely generated?
Hi Tyler, We run all the localization work in the pipeline so every time the bot performed localization, someone in our team would see this issue. So I start the issue to ask if there is any existing solution for this.
It's not a big problem if it is not configurable now. Thanks for your quick response.
Hi,
What if add replace("\r(\n)?","\r\n")
on result string of JSON.stringify
?
writeFileSync(resolvedOutFile, JSON.stringify(jsonResult, undefined, 2).replace("\r(\n)?","\r\n"))
Hi,
We have seen in https://github.com/dotnet/vscode-csharp/blob/main/l10n/bundle.l10n.json, initially everything is end with
crlf
But after adding a string and run @vscode/l10n-dev export git would complain that the line ending is changed tolf
Is there any way to use 'crlf' as the line ending?