mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-06-08 10:22:25 -04:00
Remove autoupdate feature from CLI entirely
This commit is contained in:
parent
d28e81f8dc
commit
4144911208
3 changed files with 1 additions and 50 deletions
|
@ -43,8 +43,7 @@ namespace DiscordChatExporter.Cli
|
||||||
typeof(ExportChatOptions),
|
typeof(ExportChatOptions),
|
||||||
typeof(GetChannelsOptions),
|
typeof(GetChannelsOptions),
|
||||||
typeof(GetDirectMessageChannelsOptions),
|
typeof(GetDirectMessageChannelsOptions),
|
||||||
typeof(GetGuildsOptions),
|
typeof(GetGuildsOptions)
|
||||||
//typeof(UpdateAppOptions)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Parse command line arguments
|
// Parse command line arguments
|
||||||
|
@ -55,7 +54,6 @@ namespace DiscordChatExporter.Cli
|
||||||
parsedArgs.WithParsed<GetChannelsOptions>(o => new GetChannelsVerb(o).Execute());
|
parsedArgs.WithParsed<GetChannelsOptions>(o => new GetChannelsVerb(o).Execute());
|
||||||
parsedArgs.WithParsed<GetDirectMessageChannelsOptions>(o => new GetDirectMessageChannelsVerb(o).Execute());
|
parsedArgs.WithParsed<GetDirectMessageChannelsOptions>(o => new GetDirectMessageChannelsVerb(o).Execute());
|
||||||
parsedArgs.WithParsed<GetGuildsOptions>(o => new GetGuildsVerb(o).Execute());
|
parsedArgs.WithParsed<GetGuildsOptions>(o => new GetGuildsVerb(o).Execute());
|
||||||
parsedArgs.WithParsed<UpdateAppOptions>(o => new UpdateAppVerb(o).Execute());
|
|
||||||
|
|
||||||
// Show token help if help requested or no verb specified
|
// Show token help if help requested or no verb specified
|
||||||
parsedArgs.WithNotParsed(errs =>
|
parsedArgs.WithNotParsed(errs =>
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
using CommandLine;
|
|
||||||
|
|
||||||
namespace DiscordChatExporter.Cli.Verbs.Options
|
|
||||||
{
|
|
||||||
[Verb("update", HelpText = "Updates this application to the latest version.")]
|
|
||||||
public class UpdateAppOptions
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue