diff --git a/Commands/UpdateCommand.cs b/Commands/UpdateCommand.cs index e753f32..ae7a56a 100644 --- a/Commands/UpdateCommand.cs +++ b/Commands/UpdateCommand.cs @@ -11,6 +11,9 @@ namespace FCPModUpdater.Commands; [UsedImplicitly] public class UpdateCommand : AsyncCommand { + public static IReadOnlyList GetUpdateableMods(IReadOnlyList mods) + => mods.Where(m => m.Source == ModSource.Git && m.Status == ModStatus.Behind).ToList(); + public override async Task ExecuteAsync(CommandContext context, ModPathSettings settings, CancellationToken cancellationToken) { @@ -41,9 +44,7 @@ public class UpdateCommand : AsyncCommand async () => await modDiscoveryService.DiscoverModsAsync(modsDirectory, ct: cancellationToken)); // Find updateable mods - var updateableMods = mods - .Where(m => m.Source == ModSource.Git && m.Status == ModStatus.Behind) - .ToList(); + var updateableMods = GetUpdateableMods(mods); if (updateableMods.Count == 0) { diff --git a/Services/GitService.cs b/Services/GitService.cs index 20ee4d3..3c02c0f 100644 --- a/Services/GitService.cs +++ b/Services/GitService.cs @@ -244,7 +244,7 @@ public partial class GitService : IGitService } } - private static IReadOnlyList ParseCommitLog(string output) + internal static IReadOnlyList ParseCommitLog(string output) { var commits = new List(); var entries = output.Split("---", StringSplitOptions.RemoveEmptyEntries); diff --git a/Services/ModDiscoveryService.cs b/Services/ModDiscoveryService.cs index 33736b9..9c97a99 100644 --- a/Services/ModDiscoveryService.cs +++ b/Services/ModDiscoveryService.cs @@ -171,7 +171,7 @@ public class ModDiscoveryService : IModDiscoveryService /// /// Tries to match a folder name to an org repo, accounting for GitHub ZIP download suffixes like -main, -master. /// - private static string? MatchRepoName(string folderName, HashSet orgRepoNames) + internal static string? MatchRepoName(string folderName, HashSet orgRepoNames) { // Direct match if (orgRepoNames.Contains(folderName)) @@ -191,7 +191,7 @@ public class ModDiscoveryService : IModDiscoveryService return null; } - private static ModStatus DetermineStatus(int behind, int ahead, bool hasLocalChanges, string? branch) + internal static ModStatus DetermineStatus(int behind, int ahead, bool hasLocalChanges, string? branch) { if (branch == null) { diff --git a/packages.lock.json b/packages.lock.json index 8ab699c..71754a8 100644 --- a/packages.lock.json +++ b/packages.lock.json @@ -29,7 +29,6 @@ "Spectre.Console": "0.53.1" } } - }, - "net10.0/linux-x64": {} + } } } \ No newline at end of file