Skip to content

Commit 0150fdf

Browse files
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
1 parent a926ae7 commit 0150fdf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

BuildTools/update-assemblyinfo.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ try {
158158
}
159159

160160
foreach ($file in $templateFiles) {
161-
[string]$in = (Get-Content $file.Input) -Join [System.Environment]::NewLine;
161+
# Force CRLF regardless of platform: the repo's .cs files are CRLF, and the format
162+
# hook flags the generated file on every run if it is written with LF on Linux.
163+
[string]$in = (Get-Content $file.Input) -Join "`r`n";
162164

163165
$out = $in.Replace('$INSERTVERSION$', $fullVersionNumber);
164166
$out = $out.Replace('$INSERTMAJORVERSION$', $major);
@@ -173,7 +175,7 @@ try {
173175
$out = $out.Replace('$INSERTVERSIONNAMEPOSTFIX$', $postfixVersionName);
174176
$out = $out.Replace('$INSERTBUILDCONFIG$', $buildConfig);
175177

176-
if ((-not (Test-File $file.Output)) -or (((Get-Content $file.Output) -Join [System.Environment]::NewLine) -ne $out)) {
178+
if ((-not (Test-File $file.Output)) -or (((Get-Content $file.Output) -Join "`r`n") -ne $out)) {
177179
$utf8NoBom = New-Object System.Text.UTF8Encoding($false);
178180
[System.IO.File]::WriteAllText($file.Output, $out, $utf8NoBom);
179181
}

0 commit comments

Comments
 (0)