mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
Generate version-info files with CRLF on all platforms
update-assemblyinfo.ps1 joined the template lines with Environment.NewLine, so on Linux the generated DecompilerVersionInfo.cs was written with LF and the pre-commit format hook re-flagged all of its lines on every single commit. The repo's .cs files are CRLF; write the generated file that way regardless of platform, and compare with the same separator so the up-to-date check stays consistent. Assisted-by: Claude:claude-fable-5:Claude Code
This commit is contained in:
committed by
Siegfried Pammer
parent
a926ae7e8b
commit
579032a65e
@@ -158,7 +158,9 @@ try {
|
||||
}
|
||||
|
||||
foreach ($file in $templateFiles) {
|
||||
[string]$in = (Get-Content $file.Input) -Join [System.Environment]::NewLine;
|
||||
# Force CRLF regardless of platform: the repo's .cs files are CRLF, and the format
|
||||
# hook flags the generated file on every run if it is written with LF on Linux.
|
||||
[string]$in = (Get-Content $file.Input) -Join "`r`n";
|
||||
|
||||
$out = $in.Replace('$INSERTVERSION$', $fullVersionNumber);
|
||||
$out = $out.Replace('$INSERTMAJORVERSION$', $major);
|
||||
@@ -173,7 +175,7 @@ try {
|
||||
$out = $out.Replace('$INSERTVERSIONNAMEPOSTFIX$', $postfixVersionName);
|
||||
$out = $out.Replace('$INSERTBUILDCONFIG$', $buildConfig);
|
||||
|
||||
if ((-not (Test-File $file.Output)) -or (((Get-Content $file.Output) -Join [System.Environment]::NewLine) -ne $out)) {
|
||||
if ((-not (Test-File $file.Output)) -or (((Get-Content $file.Output) -Join "`r`n") -ne $out)) {
|
||||
$utf8NoBom = New-Object System.Text.UTF8Encoding($false);
|
||||
[System.IO.File]::WriteAllText($file.Output, $out, $utf8NoBom);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user