@@ -171,29 +171,29 @@ public static void UpdateNanoCLRInstance(
171171 "Upate nanoCLR instance" ,
172172 Settings . LoggingLevel . Verbose ) ;
173173
174- var arguments = "instance --update" ;
174+ string arguments = "instance --update" ;
175175
176176 if ( ! string . IsNullOrEmpty ( clrVersion ) )
177177 {
178178 arguments += $ " --clrversion { clrVersion } ";
179179 }
180180
181- var cmd = Cli . Wrap ( "nanoclr" )
181+ Command cmd = Cli . Wrap ( "nanoclr" )
182182 . WithArguments ( arguments )
183183 . WithValidation ( CommandResultValidation . None ) ;
184184
185185 // setup cancellation token with a timeout of 1 minute
186186 using ( var cts = new CancellationTokenSource ( TimeSpan . FromMinutes ( 1 ) ) )
187187 {
188- var cliResult = cmd . ExecuteBufferedAsync ( cts . Token ) . Task . Result ;
188+ BufferedCommandResult cliResult = cmd . ExecuteBufferedAsync ( cts . Token ) . Task . Result ;
189189
190190 if ( cliResult . ExitCode == 0 )
191191 {
192192 // this will be either (on update):
193193 // Updated to v1.8.1.102
194194 // or (on same version):
195195 // Already at v1.8.1.102
196- var regexResult = Regex . Match ( cliResult . StandardOutput , @"((?>v)(?'version'\d+\.\d+\.\d+\.\d+))" ) ;
196+ Match regexResult = Regex . Match ( cliResult . StandardOutput , @"((?>v)(?'version'\d+\.\d+\.\d+\.\d+))" ) ;
197197
198198 if ( regexResult . Success )
199199 {
@@ -203,17 +203,24 @@ public static void UpdateNanoCLRInstance(
203203 }
204204 else
205205 {
206- logger . LogPanicMessage ( $ "*** Failed to update nanoCLR instance ***" ) ;
206+ LogUpdateFailure ( logger , cliResult ) ;
207207 }
208208 }
209209 else
210210 {
211- logger . LogMessage (
212- $ "Failed to update nanoCLR instance. Exit code { cliResult . ExitCode } .",
213- Settings . LoggingLevel . Detailed ) ;
211+ LogUpdateFailure ( logger , cliResult ) ;
214212 }
215213 }
216214 }
215+
216+ private static void LogUpdateFailure (
217+ LogMessenger logger ,
218+ BufferedCommandResult cliResult )
219+ {
220+ logger . LogPanicMessage ( $ "*** Failed to update nanoCLR instance ***") ;
221+ logger . LogPanicMessage ( $ "\r \n Exit code { cliResult . ExitCode } . \r \n Output: { Environment . NewLine } { cliResult . StandardOutput } ") ;
222+ }
223+
217224 internal class NuGetPackage
218225 {
219226 public string [ ] Versions { get ; set ; }
0 commit comments