-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tons of little issues found while running the app through the UI (#…
…757) * Fix tons of little issues found while running the app through the UI * Fix a few tests
- Loading branch information
Showing
6 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using NexusMods.Abstractions.CLI; | ||
using NexusMods.DataModel.Loadouts.Extensions; | ||
using NexusMods.DataModel.Loadouts.Markers; | ||
using NexusMods.Paths; | ||
|
||
namespace NexusMods.CLI.Verbs; | ||
|
||
// ReSharper disable once ClassNeverInstantiated.Global | ||
/// <summary> | ||
/// Compute and run the steps needed to apply a Loadout to a game folder | ||
/// </summary> | ||
public class Ingest : AVerb<LoadoutMarker>, IRenderingVerb | ||
{ | ||
/// <inheritdoc /> | ||
public IRenderer Renderer { get; set; } = null!; | ||
|
||
/// <summary> | ||
/// DI constructor | ||
/// </summary> | ||
/// <param name="loadoutSynchronizer"></param> | ||
public Ingest() | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public static VerbDefinition Definition => new("ingest", "Ingest changes from the game folders into the given loadout", new OptionDefinition[] | ||
{ | ||
new OptionDefinition<LoadoutMarker>("l", "loadout", "Loadout ingest changes into"), | ||
}); | ||
|
||
/// <inheritdoc /> | ||
public async Task<int> Run(LoadoutMarker loadout, CancellationToken token) | ||
{ | ||
var state = await Renderer.WithProgress(token, | ||
async () => await loadout.Value.Ingest()); | ||
|
||
loadout.Alter("Ingest changes from the game folder", _ => state); | ||
|
||
await Renderer.Render($"Ingested game folder changes into {loadout.Value.Name}"); | ||
|
||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters