@@ -27,7 +27,7 @@ public static class UpdateMethods
2727 public static async void ExecuteUpdate ( string zipFilePath )
2828 {
2929 string scriptFileName = await UpdateMethods . ExtractPowershellScript ( ) . ConfigureAwait ( false ) ;
30- using Process process = Process . Start ( new ProcessStartInfo
30+ using Process process = Process . Start ( startInfo : new ( )
3131 {
3232 WorkingDirectory = Path . GetTempPath ( ) ,
3333 UseShellExecute = false ,
@@ -44,7 +44,7 @@ public static async void ExecuteUpdate(string zipFilePath)
4444 /// <param name="majorVersion">The major version of the release.</param>
4545 /// <param name="cancellationToken">Optionally used to propagate cancellation requests.</param>
4646 /// <returns>Information related to a release. Returns <see langword="null"/> if not found or an error occurs.</returns>
47- public static async Task < IReleaseInfo ? > FetchLatestVersionedRelease ( int majorVersion , CancellationToken cancellationToken = default )
47+ public static async Task < IReleaseInfo ? > FetchLatestVersionedReleaseAsync ( int majorVersion , CancellationToken cancellationToken = default )
4848 {
4949 try
5050 {
@@ -66,14 +66,6 @@ public static async void ExecuteUpdate(string zipFilePath)
6666 return default ;
6767 }
6868
69- /// <summary>
70- /// Fetches the latest 2.x release.
71- /// </summary>
72- /// <param name="cancellationToken">Optionally used to propagate cancellation requests.</param>
73- /// <returns>Information related to a release. Returns <see langword="null"/> if not found or an error occurs.</returns>
74- public static Task < IReleaseInfo ? > FetchLatest2xReleaseAsync ( CancellationToken cancellationToken = default ) =>
75- UpdateMethods . FetchLatestVersionedRelease ( 2 , cancellationToken ) ;
76-
7769 /// <summary>
7870 /// Fetches an array of the interim update releases for the current major version of the application to the latest.
7971 /// Only checks up to <paramref name="maxReleases"/> number of tags/releases.
@@ -116,8 +108,8 @@ private static async Task<string> ExtractPowershellScript()
116108 {
117109 try
118110 {
119- return await UpdateMethods . _client . GetFromJsonAsync < T > ( $ "https://api.github.com/repos/mburbea/koar-item-editor/{ suffix } ", UpdateMethods . _jsonOptions , cancellationToken )
120- . ConfigureAwait ( false ) ;
111+ string uri = $ "https://api.github.com/repos/mburbea/koar-item-editor/{ suffix } ";
112+ return await UpdateMethods . _client . GetFromJsonAsync < T > ( uri , UpdateMethods . _jsonOptions , cancellationToken ) . ConfigureAwait ( false ) ;
121113 }
122114 catch ( HttpRequestException e ) when ( e . StatusCode == HttpStatusCode . NotFound )
123115 {
@@ -169,7 +161,7 @@ private sealed class Release : IReleaseInfo
169161
170162 public Version Version => this . _version ??= new ( this . TagName . Length != 0 ? this . TagName [ 1 ..] : "0.0.0" ) ;
171163
172- public ReleaseAsset ? ZipFileAsset => this . _zipFileAsset ??= this . Assets . FirstOrDefault ( asset => asset . IsZipFile ) ;
164+ public ReleaseAsset ? ZipFileAsset => this . _zipFileAsset ??= this . Assets . FirstOrDefault ( asset => asset . ContentType == "application/zip" ) ;
173165
174166 public int ZipFileSize => this . ZipFileAsset ? . Size ?? 0 ;
175167
@@ -182,8 +174,6 @@ private sealed class ReleaseAsset
182174
183175 public string ContentType { get ; set ; } = string . Empty ;
184176
185- public bool IsZipFile => this . ContentType == "application/zip" ;
186-
187177 public int Size { get ; set ; }
188178 }
189179
0 commit comments