From 5b640471b1fae6ea083af94262c215eeeed05353 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Tue, 24 May 2022 13:41:12 +0300 Subject: [PATCH] Cli: Update command should update all solutions under the folder --- .../Volo/Abp/Cli/Commands/UpdateCommand.cs | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs index fdc9b83fcf..6df7418e9d 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/UpdateCommand.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; @@ -56,22 +57,30 @@ public class UpdateCommand : IConsoleCommand, ITransientDependency private async Task UpdateNugetPackages(CommandLineArgs commandLineArgs, string directory, string version) { - - var solution = commandLineArgs.Options.GetOrNull(Options.SolutionName.Short, Options.SolutionName.Long); - if (solution.IsNullOrWhiteSpace()) + var solutions = new List(); + var givenSolution = commandLineArgs.Options.GetOrNull(Options.SolutionName.Short, Options.SolutionName.Long); + + if (givenSolution.IsNullOrWhiteSpace()) + { + solutions.AddRange(Directory.GetFiles(directory, "*.sln", SearchOption.AllDirectories)); + } + else { - solution = Directory.GetFiles(directory, "*.sln", SearchOption.AllDirectories).FirstOrDefault(); + solutions.Add(givenSolution); } var checkAll = commandLineArgs.Options.ContainsKey(Options.CheckAll.Long); - if (solution != null) + if (solutions.Any()) { - var solutionName = Path.GetFileName(solution).RemovePostFix(".sln"); + foreach (var solution in solutions) + { + var solutionName = Path.GetFileName(solution).RemovePostFix(".sln"); - await _nugetPackagesVersionUpdater.UpdateSolutionAsync(solution, checkAll: checkAll, version: version); + await _nugetPackagesVersionUpdater.UpdateSolutionAsync(solution, checkAll: checkAll, version: version); - Logger.LogInformation($"Volo packages are updated in {solutionName} solution."); + Logger.LogInformation($"Volo packages are updated in {solutionName} solution."); + } return; }