@@ -171,29 +171,29 @@ public static void UpdateNanoCLRInstance(
171
171
"Upate nanoCLR instance" ,
172
172
Settings . LoggingLevel . Verbose ) ;
173
173
174
- var arguments = "instance --update" ;
174
+ string arguments = "instance --update" ;
175
175
176
176
if ( ! string . IsNullOrEmpty ( clrVersion ) )
177
177
{
178
178
arguments += $ " --clrversion { clrVersion } ";
179
179
}
180
180
181
- var cmd = Cli . Wrap ( "nanoclr" )
181
+ Command cmd = Cli . Wrap ( "nanoclr" )
182
182
. WithArguments ( arguments )
183
183
. WithValidation ( CommandResultValidation . None ) ;
184
184
185
185
// setup cancellation token with a timeout of 1 minute
186
186
using ( var cts = new CancellationTokenSource ( TimeSpan . FromMinutes ( 1 ) ) )
187
187
{
188
- var cliResult = cmd . ExecuteBufferedAsync ( cts . Token ) . Task . Result ;
188
+ BufferedCommandResult cliResult = cmd . ExecuteBufferedAsync ( cts . Token ) . Task . Result ;
189
189
190
190
if ( cliResult . ExitCode == 0 )
191
191
{
192
192
// this will be either (on update):
193
193
// Updated to v1.8.1.102
194
194
// or (on same version):
195
195
// 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+))" ) ;
197
197
198
198
if ( regexResult . Success )
199
199
{
@@ -203,17 +203,24 @@ public static void UpdateNanoCLRInstance(
203
203
}
204
204
else
205
205
{
206
- logger . LogPanicMessage ( $ "*** Failed to update nanoCLR instance ***" ) ;
206
+ LogUpdateFailure ( logger , cliResult ) ;
207
207
}
208
208
}
209
209
else
210
210
{
211
- logger . LogMessage (
212
- $ "Failed to update nanoCLR instance. Exit code { cliResult . ExitCode } .",
213
- Settings . LoggingLevel . Detailed ) ;
211
+ LogUpdateFailure ( logger , cliResult ) ;
214
212
}
215
213
}
216
214
}
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
+
217
224
internal class NuGetPackage
218
225
{
219
226
public string [ ] Versions { get ; set ; }
0 commit comments