Skip to content

Commit

Permalink
Fix changelog construction
Browse files Browse the repository at this point in the history
  • Loading branch information
spodskubka committed May 29, 2017
1 parent fdd8e5e commit 50368cf
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions RemoteTerminal/ChangelogManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ public static class ChangelogManager
private const string LastReadChangelogSettingName = "LastReadChangelog";

/// <summary>
/// This array contains, in reverse order, all versions of the app for which a changelog is available.
/// This array contains, in reverse order, all previous versions of the app for which a changelog is available.
/// </summary>
/// <remarks>The first entry should always be <see cref="CurrentVersion"/>.</remarks>
private static readonly string[] Versions = new[]
/// <remarks><see cref="CurrentVersion"/> must not be included in this list.</remarks>
private static readonly string[] PreviousVersions = new[]
{
CurrentVersion,
"1.9.0",
"1.8.2",
};
Expand Down Expand Up @@ -71,14 +70,18 @@ public static string ProduceChangelog()
changelog.Append(ReadHtmlFile("head")
.Replace("{CurrentVersion}", CurrentVersion));

foreach (string version in Versions)
changelog.Append(ReadHtmlFile(CurrentVersion));
if (CurrentVersion != lastReadChangelog)
{
if (version == lastReadChangelog)
foreach (string version in PreviousVersions)
{
break;
}
if (version == lastReadChangelog)
{
break;
}

changelog.Append(ReadHtmlFile(version));
changelog.Append(ReadHtmlFile(version));
}
}

changelog.Append(ReadHtmlFile("tail"));
Expand Down

0 comments on commit 50368cf

Please sign in to comment.