Skip to content

Commit

Permalink
fix pre release updater and cli uri parser
Browse files Browse the repository at this point in the history
  • Loading branch information
LucHeart committed Nov 23, 2024
1 parent ad72c6e commit 0e94bee
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ShockOsc/Cli/MauiCliOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public sealed class MauiCliOptions : CliOptions
public required bool Console { get; init; }

[Option("uri", Required = false, HelpText = "Custom URI for callbacks")]
public required string Uri { get; init; }
public required string? Uri { get; init; }
}
5 changes: 2 additions & 3 deletions ShockOsc/Platforms/Windows/WindowsEntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,13 @@ private static void Start(MauiCliOptions config)
{
using var pipeClientStream = new NamedPipeClientStream(".", "OpenShock.ShockOsc", PipeDirection.Out);
pipeClientStream.Connect(500);

var parsedUri = UriParser.Parse(config.Uri);


using var writer = new StreamWriter(pipeClientStream);
writer.AutoFlush = true;

if (!string.IsNullOrEmpty(config.Uri))
{
var parsedUri = UriParser.Parse(config.Uri);
var pipeMessage = parsedUri.Type switch
{
UriParameterType.Show => new PipeMessage { Type = PipeMessageType.Show },
Expand Down
4 changes: 2 additions & 2 deletions ShockOsc/Services/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ await JsonSerializer.DeserializeAsync<IEnumerable<GithubReleaseResponse>>(

listOfValid.Add((release, version));
}

(GithubReleaseResponse, SemVersion)? newestPreRelease = listOfValid.OrderByDescending(x => x.Item2).FirstOrDefault();
(GithubReleaseResponse, SemVersion)? newestPreRelease = listOfValid.OrderByDescending(x => x.Item2, SemVersion.PrecedenceComparer).FirstOrDefault();
var latestRelease = await GetLatestRelease();
if (newestPreRelease == null && latestRelease == null)
{
Expand Down

0 comments on commit 0e94bee

Please sign in to comment.