@@ -228,6 +228,11 @@ static async Task Main(string[] args)
228
228
// Finished install.
229
229
WriteLine ( string . Format ( "Finished installation in {0} ms." , ( DateTime . Now - installStartTime ) . TotalMilliseconds ) ) ;
230
230
ReadLine ( ) ;
231
+
232
+ int succeeded = ParseResults ( results ) . succeeded ;
233
+ bool allSucceeded = succeeded == results . Count ;
234
+ ExitCode exitCode = allSucceeded ? ExitCode . Success : ExitCode . InstallFailure ;
235
+ Environment . Exit ( ( int ) exitCode ) ;
231
236
}
232
237
catch ( Exception ex )
233
238
{
@@ -268,6 +273,12 @@ private static void GetSettings(string[] args)
268
273
}
269
274
270
275
private static string BuildUpdateString ( SortedList < string , dynamic > results )
276
+ {
277
+ var ( attempted , succeeded , _) = ParseResults ( results ) ;
278
+ return string . Format ( "\t {0}/{1} module archives processed, {2}/{0} succeeded." , attempted , results . Count , succeeded ) ;
279
+ }
280
+
281
+ private static ( int attempted , int succeeded , int failed ) ParseResults ( SortedList < string , dynamic > results )
271
282
{
272
283
// Get counts.
273
284
int attempted = 0 ;
@@ -293,7 +304,7 @@ private static string BuildUpdateString(SortedList<string, dynamic> results)
293
304
}
294
305
}
295
306
296
- return string . Format ( " \t {0}/{1} module archives processed, {2}/{0} succeeded." , attempted , results . Count , succeeded ) ;
307
+ return ( attempted , succeeded , failed ) ;
297
308
}
298
309
299
310
private static void WriteException ( Exception ex , int maxDepth = 10 , int depth = 0 )
0 commit comments