Skip to content

Commit 630fd10

Browse files
authored
Adds outdated command. Closes #657 (#659)
1 parent 3db86e0 commit 630fd10

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+

dev-proxy/ProxyHost.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT License.
33

44
using Microsoft.DevProxy.Abstractions;
5+
using Microsoft.Extensions.Configuration;
56
using Microsoft.Extensions.Logging;
67
using System.CommandLine;
78
using System.Net;
@@ -300,6 +301,11 @@ public RootCommand GetRootCommand(IProxyLogger logger)
300301

301302
command.Add(presetCommand);
302303

304+
var outdatedCommand = new Command("outdated", "Check for new version");
305+
306+
outdatedCommand.SetHandler(async () => await OutdatedCommandHandler.CheckVersion(logger));
307+
command.Add(outdatedCommand);
308+
303309
return command;
304310
}
305311

0 commit comments

Comments
 (0)