mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Re-add opening Modlists with CLI args
This commit is contained in:
parent
5a8383d12f
commit
633465b790
@ -17,11 +17,13 @@ using Wabbajack.DTOs.Interventions;
|
||||
using Wabbajack.Interventions;
|
||||
using Wabbajack.LoginManagers;
|
||||
using Wabbajack.Models;
|
||||
using Wabbajack.Paths;
|
||||
using Wabbajack.Paths.IO;
|
||||
using Wabbajack.Services.OSIntegrated;
|
||||
using Wabbajack.UserIntervention;
|
||||
using Wabbajack.Util;
|
||||
using WebView2.Runtime.AutoInstaller;
|
||||
using Ext = Wabbajack.Common.Ext;
|
||||
|
||||
namespace Wabbajack
|
||||
{
|
||||
@ -47,10 +49,18 @@ namespace Wabbajack
|
||||
|
||||
var args = e.Args;
|
||||
|
||||
|
||||
RxApp.MainThreadScheduler.Schedule(0, (_, _) =>
|
||||
{
|
||||
if (args.Length > 0)
|
||||
if (args.Length == 1)
|
||||
{
|
||||
var arg = args[0].ToAbsolutePath();
|
||||
if (arg.FileExists() && arg.Extension == Ext.Wabbajack)
|
||||
{
|
||||
var mainWindow = _host.Services.GetRequiredService<MainWindow>();
|
||||
mainWindow!.Show();
|
||||
return Disposable.Empty;
|
||||
}
|
||||
} else if (args.Length > 0)
|
||||
{
|
||||
var builder = _host.Services.GetRequiredService<CommandLineBuilder>();
|
||||
builder.Run(e.Args).ContinueWith(async x =>
|
||||
@ -65,6 +75,8 @@ namespace Wabbajack
|
||||
mainWindow!.Show();
|
||||
return Disposable.Empty;
|
||||
}
|
||||
|
||||
return Disposable.Empty;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,14 @@
|
||||
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
namespace Wabbajack;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Wabbajack.Verbs;
|
||||
using Wabbajack.CLI.Builder;
|
||||
|
||||
public static class CommandLineBuilderExtensions{
|
||||
namespace Wabbajack;
|
||||
|
||||
public static void AddCLIVerbs(this IServiceCollection services) {
|
||||
CommandLineBuilder.RegisterCommand<NexusLogin>(NexusLogin.Definition, c => ((NexusLogin)c).Run);
|
||||
services.AddSingleton<NexusLogin>();
|
||||
}
|
||||
public static class CommandLineBuilderExtensions
|
||||
{
|
||||
public static void AddCLIVerbs(this IServiceCollection services)
|
||||
{
|
||||
CommandLineBuilder.RegisterCommand<NexusLogin>(NexusLogin.Definition, c => ((NexusLogin)c).Run);
|
||||
services.AddSingleton<NexusLogin>();
|
||||
}
|
||||
}
|
@ -25,6 +25,7 @@ using Wabbajack.Messages;
|
||||
using Wabbajack.Models;
|
||||
using Wabbajack.Networking.WabbajackClientApi;
|
||||
using Wabbajack.Paths;
|
||||
using Wabbajack.Paths.IO;
|
||||
using Wabbajack.UserIntervention;
|
||||
using Wabbajack.View_Models;
|
||||
|
||||
@ -219,16 +220,17 @@ namespace Wabbajack
|
||||
|
||||
private static bool IsStartingFromModlist(out AbsolutePath modlistPath)
|
||||
{
|
||||
/* TODO
|
||||
if (CLIArguments.InstallPath == null)
|
||||
var args = Environment.GetCommandLineArgs();
|
||||
if (args.Length == 2)
|
||||
{
|
||||
modlistPath = default;
|
||||
return false;
|
||||
var arg = args[1].ToAbsolutePath();
|
||||
if (arg.FileExists() && arg.Extension == Ext.Wabbajack)
|
||||
{
|
||||
modlistPath = arg;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
modlistPath = (AbsolutePath)CLIArguments.InstallPath;
|
||||
return true;
|
||||
*/
|
||||
modlistPath = default;
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user