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.Interventions;
|
||||||
using Wabbajack.LoginManagers;
|
using Wabbajack.LoginManagers;
|
||||||
using Wabbajack.Models;
|
using Wabbajack.Models;
|
||||||
|
using Wabbajack.Paths;
|
||||||
using Wabbajack.Paths.IO;
|
using Wabbajack.Paths.IO;
|
||||||
using Wabbajack.Services.OSIntegrated;
|
using Wabbajack.Services.OSIntegrated;
|
||||||
using Wabbajack.UserIntervention;
|
using Wabbajack.UserIntervention;
|
||||||
using Wabbajack.Util;
|
using Wabbajack.Util;
|
||||||
using WebView2.Runtime.AutoInstaller;
|
using WebView2.Runtime.AutoInstaller;
|
||||||
|
using Ext = Wabbajack.Common.Ext;
|
||||||
|
|
||||||
namespace Wabbajack
|
namespace Wabbajack
|
||||||
{
|
{
|
||||||
@ -47,10 +49,18 @@ namespace Wabbajack
|
|||||||
|
|
||||||
var args = e.Args;
|
var args = e.Args;
|
||||||
|
|
||||||
|
|
||||||
RxApp.MainThreadScheduler.Schedule(0, (_, _) =>
|
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>();
|
var builder = _host.Services.GetRequiredService<CommandLineBuilder>();
|
||||||
builder.Run(e.Args).ContinueWith(async x =>
|
builder.Run(e.Args).ContinueWith(async x =>
|
||||||
@ -65,6 +75,8 @@ namespace Wabbajack
|
|||||||
mainWindow!.Show();
|
mainWindow!.Show();
|
||||||
return Disposable.Empty;
|
return Disposable.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Disposable.Empty;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
|
||||||
namespace Wabbajack;
|
|
||||||
using Wabbajack.Verbs;
|
using Wabbajack.Verbs;
|
||||||
using Wabbajack.CLI.Builder;
|
using Wabbajack.CLI.Builder;
|
||||||
|
|
||||||
public static class CommandLineBuilderExtensions{
|
namespace Wabbajack;
|
||||||
|
|
||||||
public static void AddCLIVerbs(this IServiceCollection services) {
|
public static class CommandLineBuilderExtensions
|
||||||
|
{
|
||||||
|
public static void AddCLIVerbs(this IServiceCollection services)
|
||||||
|
{
|
||||||
CommandLineBuilder.RegisterCommand<NexusLogin>(NexusLogin.Definition, c => ((NexusLogin)c).Run);
|
CommandLineBuilder.RegisterCommand<NexusLogin>(NexusLogin.Definition, c => ((NexusLogin)c).Run);
|
||||||
services.AddSingleton<NexusLogin>();
|
services.AddSingleton<NexusLogin>();
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ using Wabbajack.Messages;
|
|||||||
using Wabbajack.Models;
|
using Wabbajack.Models;
|
||||||
using Wabbajack.Networking.WabbajackClientApi;
|
using Wabbajack.Networking.WabbajackClientApi;
|
||||||
using Wabbajack.Paths;
|
using Wabbajack.Paths;
|
||||||
|
using Wabbajack.Paths.IO;
|
||||||
using Wabbajack.UserIntervention;
|
using Wabbajack.UserIntervention;
|
||||||
using Wabbajack.View_Models;
|
using Wabbajack.View_Models;
|
||||||
|
|
||||||
@ -219,16 +220,17 @@ namespace Wabbajack
|
|||||||
|
|
||||||
private static bool IsStartingFromModlist(out AbsolutePath modlistPath)
|
private static bool IsStartingFromModlist(out AbsolutePath modlistPath)
|
||||||
{
|
{
|
||||||
/* TODO
|
var args = Environment.GetCommandLineArgs();
|
||||||
if (CLIArguments.InstallPath == null)
|
if (args.Length == 2)
|
||||||
{
|
{
|
||||||
modlistPath = default;
|
var arg = args[1].ToAbsolutePath();
|
||||||
return false;
|
if (arg.FileExists() && arg.Extension == Ext.Wabbajack)
|
||||||
|
{
|
||||||
|
modlistPath = arg;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
modlistPath = (AbsolutePath)CLIArguments.InstallPath;
|
|
||||||
return true;
|
|
||||||
*/
|
|
||||||
modlistPath = default;
|
modlistPath = default;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user