Skip to content

Commit

Permalink
fix: NormalizeEndOfLine
Browse files Browse the repository at this point in the history
  • Loading branch information
netpyoung committed Dec 1, 2024
1 parent 3fea8e3 commit 06db849
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private static void ExtractBaseHeaderAndContent(string path, string startString,
return;
}

string txt = File.ReadAllText(path);
string txt = NormalizeEndOfLine(File.ReadAllText(path), ReleaseNoteConfigMaker.E_END_OF_LINE.LF);
int index = txt.IndexOf(startString);
if (index == -1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task TestAppendAtTop()
(Exception? renderExOrNull, string text) = await TemplateRenderer.RenderFragments(templatePath, config, versionData, splitted);
Assert.IsNull(renderExOrNull);

await File.WriteAllTextAsync("ChangeLog.md", $"Old text.{Environment.NewLine}");
await File.WriteAllTextAsync("ChangeLog.md", "Old text.\n");

Exception? ex = await Command_Build.AppendToNewsFile(config, "release notes start", text, "ChangeLog.md");
Assert.IsNull(ex);
Expand Down Expand Up @@ -108,7 +108,7 @@ public async Task TestAppendAtTopWithHint()
};

string topLine = string.Empty;
string startString = ".. towncrier release notes start\r\n";
string startString = ".. towncrier release notes start\n";

ReleaseNoteConfig config = new ReleaseNoteConfig();
config.Maker.IsAllBullets = true;
Expand Down

0 comments on commit 06db849

Please sign in to comment.