File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
src/Atc.CodingRules.Updater.CLI Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 11namespace Atc . CodingRules . Updater . CLI . Commands ;
22
3+ [ SuppressMessage ( "Globalization" , "CA1303:Do not pass literals as localized parameters" , Justification = "OK." ) ]
34public class RootCommand : AsyncCommand < RootCommandSettings >
45{
56 public override Task < int > ExecuteAsync (
@@ -14,6 +15,12 @@ public override Task<int> ExecuteAsync(
1415 private static async Task < int > ExecuteInternalAsync (
1516 RootCommandSettings settings )
1617 {
18+ if ( ! NetworkInformationHelper . HasConnection ( ) )
19+ {
20+ System . Console . WriteLine ( "This tool requires internet connection!" ) ;
21+ return ConsoleExitStatusCodes . Failure ;
22+ }
23+
1724 if ( settings . IsOptionValueTrue ( settings . Version ) )
1825 {
1926 try
@@ -30,7 +37,6 @@ private static async Task<int> ExecuteInternalAsync(
3037 return ConsoleExitStatusCodes . Success ;
3138 }
3239
33- [ SuppressMessage ( "Globalization" , "CA1303:Do not pass literals as localized parameters" , Justification = "OK." ) ]
3440 private static void HandleVersionOption ( )
3541 {
3642 System . Console . WriteLine ( CliHelper . GetCurrentVersion ( ) . ToString ( ) ) ;
Original file line number Diff line number Diff line change 11// ReSharper disable SuggestBaseTypeForParameter
2-
3- using Atc . CodingRules . Updater . CLI . Models . Options ;
4-
52namespace Atc . CodingRules . Updater . CLI . Commands ;
63
4+ [ SuppressMessage ( "Globalization" , "CA1303:Do not pass literals as localized parameters" , Justification = "OK." ) ]
75public class RunCommand : AsyncCommand < RunCommandSettings >
86{
97 private readonly ILogger < RunCommand > logger ;
@@ -22,6 +20,12 @@ public override Task<int> ExecuteAsync(
2220 private async Task < int > ExecuteInternalAsync (
2321 RunCommandSettings settings )
2422 {
23+ if ( ! NetworkInformationHelper . HasConnection ( ) )
24+ {
25+ System . Console . WriteLine ( "This tool requires internet connection!" ) ;
26+ return ConsoleExitStatusCodes . Failure ;
27+ }
28+
2529 ConsoleHelper . WriteHeader ( ) ;
2630
2731 var projectPath = new DirectoryInfo ( settings . ProjectPath ) ;
Original file line number Diff line number Diff line change 1313global using Atc . CodingRules . Updater . CLI . Commands . DescriptionAttributes ;
1414global using Atc . CodingRules . Updater . CLI . Commands . Settings ;
1515global using Atc . CodingRules . Updater . CLI . Extensions ;
16+ global using Atc . CodingRules . Updater . CLI . Models . Options ;
1617global using Atc . Console . Spectre ;
1718global using Atc . Console . Spectre . CommandSettings ;
1819global using Atc . Console . Spectre . Factories ;
You can’t perform that action at this time.
0 commit comments