File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ using Microsoft . Extensions . Logging ;
2
+
3
+ namespace Microsoft . DevProxy ;
4
+
5
+ public static class OutdatedCommandHandler
6
+ {
7
+ public static async Task CheckVersion ( ILogger logger )
8
+ {
9
+ var releaseInfo = await UpdateNotification . CheckForNewVersion ( ProxyCommandHandler . Configuration . NewVersionNotification ) ;
10
+ logger . LogInformation ( releaseInfo ? . Version ) ;
11
+ }
12
+ }
13
+
Original file line number Diff line number Diff line change 2
2
// Licensed under the MIT License.
3
3
4
4
using Microsoft . DevProxy . Abstractions ;
5
+ using Microsoft . Extensions . Configuration ;
5
6
using Microsoft . Extensions . Logging ;
6
7
using System . CommandLine ;
7
8
using System . Net ;
@@ -300,6 +301,11 @@ public RootCommand GetRootCommand(IProxyLogger logger)
300
301
301
302
command . Add ( presetCommand ) ;
302
303
304
+ var outdatedCommand = new Command ( "outdated" , "Check for new version" ) ;
305
+
306
+ outdatedCommand . SetHandler ( async ( ) => await OutdatedCommandHandler . CheckVersion ( logger ) ) ;
307
+ command . Add ( outdatedCommand ) ;
308
+
303
309
return command ;
304
310
}
305
311
You can’t perform that action at this time.
0 commit comments