Skip to content

Commit

Permalink
Fix dmg not automatically being detected
Browse files Browse the repository at this point in the history
  • Loading branch information
Deadpikle committed Oct 5, 2024
1 parent e128349 commit 82c3190
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/NetSparkle.Tests.AppCastGenerator/AppCastMakerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public void CanGetVersionFromName()
Assert.Equal("2.10.1", AppCastMaker.GetVersionFromName("appsetup2.10.1.exe"));

// #623
Assert.Equal("1.3.0", AppCastMaker.GetVersionFromName("setup-something-1.3.0.dmg"));
Assert.Equal("2.10.1", AppCastMaker.GetVersionFromName("app-setup-2.10.1.exe"));
Assert.Equal("2.10.1", AppCastMaker.GetVersionFromName("my-app-setup-2.10.1.exe"));
Assert.Equal("2.10.1", AppCastMaker.GetVersionFromName("my-app-setup-2.10.1.exe"));
Expand Down
3 changes: 1 addition & 2 deletions src/NetSparkle.Tools.AppCastGenerator/AppCastMaker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ private static string RemoveTextBlockFromRight(string input)

tempSegment = string.IsNullOrWhiteSpace(tempSegment) ? segment : segment + "." + tempSegment;
tempSegment = tempSegment.Trim('.');

if (ContainsValidVersionInfo(tempSegment))
{
lastValidVersionLeft = tempSegment;
Expand Down Expand Up @@ -207,7 +206,7 @@ private static string RemoveTextBlockFromRight(string input)

// Handle a sampling of complex extensions and remove them if they exist
List<string> extensionPatterns = [@"\.tar\.gz$", @"\.tar$", @"\.gz$", @"\.zip$", @"\.txt$",
@"\.exe$", @"\.bin$", @"\.msi$", @"\.excel", @"\.mcdx", @"\.pdf", @"\.dll", @"\.ted"];
@"\.exe$", @"\.bin$", @"\.msi$", @"\.excel", @"\.mcdx", @"\.pdf", @"\.dll", @"\.ted", @"\.dmg"];
// handle user-defined extensions
if (extensions != null)
{
Expand Down

0 comments on commit 82c3190

Please sign in to comment.