Remove autoupdate feature from CLI entirely

This commit is contained in:
Oleksii Holub
2018-11-02 16:24:06 +02:00
parent d28e81f8dc
commit 4144911208
3 changed files with 1 additions and 50 deletions

View File

@@ -1,9 +0,0 @@
using CommandLine;
namespace DiscordChatExporter.Cli.Verbs.Options
{
[Verb("update", HelpText = "Updates this application to the latest version.")]
public class UpdateAppOptions
{
}
}

View File

@@ -1,38 +0,0 @@
using System;
using System.Threading.Tasks;
using DiscordChatExporter.Cli.Verbs.Options;
using DiscordChatExporter.Core.Services;
namespace DiscordChatExporter.Cli.Verbs
{
public class UpdateAppVerb : Verb<UpdateAppOptions>
{
public UpdateAppVerb(UpdateAppOptions options)
: base(options)
{
}
public override async Task ExecuteAsync()
{
// Get update service
var container = new Container();
var updateService = container.Resolve<IUpdateService>();
// TODO: this is configured only for GUI
// Get update version
var updateVersion = await updateService.CheckPrepareUpdateAsync();
if (updateVersion != null)
{
Console.WriteLine($"Updating to version {updateVersion}");
updateService.NeedRestart = false;
updateService.FinalizeUpdate();
}
else
{
Console.WriteLine("There are no application updates available.");
}
}
}
}