@@ -18,25 +18,25 @@ public class FlatpakSourcesGenerator
1818 static FlatpakSourcesGenerator ( )
1919 {
2020 HttpClient = new HttpClient ( ) ;
21- JsonSerializerOptions = new JsonSerializerOptions ( )
21+ JsonSerializerOptions = new JsonSerializerOptions
2222 {
2323 PropertyNamingPolicy = JsonNamingPolicy . CamelCase ,
2424 WriteIndented = true
2525 } ;
2626 }
27-
27+
2828 public async Task < bool > CheckRuntimeAsync ( string runtime , bool runAsUser )
2929 {
30- using var process = new Process ( )
30+ using var process = new Process
3131 {
32- StartInfo = new ProcessStartInfo ( )
32+ StartInfo = new ProcessStartInfo
3333 {
3434 FileName = "flatpak" ,
3535 ArgumentList =
3636 {
3737 "list" ,
3838 "--runtime" ,
39- "--columns=application,branch" ,
39+ "--columns=application,branch"
4040 } ,
4141 UseShellExecute = false ,
4242 RedirectStandardOutput = true ,
@@ -68,16 +68,12 @@ public async Task<bool> CheckRuntimeAsync(string runtime, bool runAsUser)
6868 return false ;
6969 }
7070
71- public async Task < List < NugetSource > > GenerateSourcesAsync ( string input ,
72- int dotnetVersion ,
73- string ? temp ,
74- bool selfContained ,
75- bool runAsUser )
71+ public async Task < List < NugetSource > > GenerateSourcesAsync ( string input , int dotnetVersion , string ? temp , bool selfContained , bool runAsUser )
7672 {
7773 input = input . Replace ( "~" , Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) ) ;
7874 temp = Path . Combine ( temp ? . Replace ( "~" , Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) ) ?? Directory . GetCurrentDirectory ( ) , "nuget-temp" ) ;
7975 Directory . CreateDirectory ( temp ) ;
80- if ( string . IsNullOrEmpty ( input ) || ! File . Exists ( input ) || Path . GetExtension ( input ) != ".csproj" )
76+ if ( string . IsNullOrEmpty ( input ) || ! File . Exists ( input ) || Path . GetExtension ( input ) != ".csproj" )
8177 {
8278 Console . Error . WriteLine ( "[Error] Invalid input csproj file path" ) ;
8379 return [ ] ;
@@ -90,9 +86,9 @@ public async Task<List<NugetSource>> GenerateSourcesAsync(string input,
9086 {
9187 return [ ] ;
9288 }
93- using var process = new Process ( )
89+ using var process = new Process
9490 {
95- StartInfo = new ProcessStartInfo ( )
91+ StartInfo = new ProcessStartInfo
9692 {
9793 FileName = "flatpak" ,
9894 ArgumentList =
@@ -131,7 +127,7 @@ public async Task<List<NugetSource>> GenerateSourcesAsync(string input,
131127 return [ ] ;
132128 }
133129 var sources = new List < NugetSource > ( ) ;
134- foreach ( var file in Directory . GetFiles ( temp , "*.nupkg.sha512" , SearchOption . AllDirectories ) )
130+ foreach ( var file in Directory . GetFiles ( temp , "*.nupkg.sha512" , SearchOption . AllDirectories ) )
135131 {
136132 using var reader = new StreamReader ( file ) ;
137133 var hash = Convert . ToHexString ( Convert . FromBase64String ( await reader . ReadToEndAsync ( ) ) ) . ToLower ( ) ;
@@ -151,7 +147,8 @@ public async Task<List<NugetSource>> GenerateSourcesAsync(string input,
151147 Directory . Delete ( temp , true ) ;
152148 if ( selfContained )
153149 {
154- foreach ( var extra in new [ ] {
150+ foreach ( var extra in new [ ]
151+ {
155152 "microsoft.aspnetcore.app.runtime.linux-arm" ,
156153 "microsoft.aspnetcore.app.runtime.linux-arm64" ,
157154 "microsoft.aspnetcore.app.runtime.linux-x64" ,
@@ -197,7 +194,7 @@ public async Task<List<NugetSource>> GenerateSourcesAsync(string input,
197194 }
198195 var filename = $ "{ name } .{ latestEntry . Version } .nupkg";
199196 Console . WriteLine ( $ "[Found] { name } ") ;
200- return new NugetSource ( )
197+ return new NugetSource
201198 {
202199 Url = $ "https://api.nuget.org/v3-flatcontainer/{ name } /{ latestEntry . Version } /{ filename } ",
203200 Sha512 = Convert . ToHexString ( Convert . FromBase64String ( latestEntry . PackageHash ) ) . ToLower ( ) ,
@@ -213,7 +210,7 @@ public async Task WriteSourcesFileAsync(List<NugetSource> sources, string? outpu
213210 {
214211 output = "nuget-sources.json" ;
215212 }
216- else if ( ! string . IsNullOrEmpty ( output ) && Path . GetExtension ( output ) != ".json" )
213+ else if ( ! string . IsNullOrEmpty ( output ) && Path . GetExtension ( output ) != ".json" )
217214 {
218215 output += ".json" ;
219216 }
0 commit comments