From 545f1afb7b80b70c41a2ff335c9d379e351234da Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 28 Apr 2020 10:46:31 +0800 Subject: [PATCH] Add SolutionName option to update command. Resolve #3753 --- .../Volo/Abp/Cli/Commands/UpdateCommand.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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 e6a2319c72..ca8bfa9bf8 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 @@ -57,7 +57,11 @@ namespace Volo.Abp.Cli.Commands .Options .GetOrNull(Options.IncludePreviews.Short, Options.IncludePreviews.Long) != null; - var solution = Directory.GetFiles(directory, "*.sln", SearchOption.AllDirectories).FirstOrDefault(); + var solution = commandLineArgs.Options.GetOrNull(Options.SolutionName.Short, Options.SolutionName.Long); + if (solution.IsNullOrWhiteSpace()) + { + solution = Directory.GetFiles(directory, "*.sln", SearchOption.AllDirectories).FirstOrDefault(); + } if (solution != null) { @@ -101,11 +105,14 @@ namespace Volo.Abp.Cli.Commands sb.AppendLine("-p|--include-previews (if supported by the template)"); sb.AppendLine("--npm (Only updates NPM packages)"); sb.AppendLine("--nuget (Only updates Nuget packages)"); + sb.AppendLine("-sp|--solution-path (Specify the solution path)"); + sb.AppendLine("-sn|--solution-name (Specify the solution name)"); sb.AppendLine(""); sb.AppendLine("Some examples:"); sb.AppendLine(""); sb.AppendLine(" abp update"); sb.AppendLine(" abp update -p"); + sb.AppendLine(" abp update -sp \"D:\\projects\\\" -sn Acme.BookStore"); sb.AppendLine(""); sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI"); @@ -125,6 +132,12 @@ namespace Volo.Abp.Cli.Commands public const string Long = "solution-path"; } + public static class SolutionName + { + public const string Short = "sn"; + public const string Long = "solution-name"; + } + public static class IncludePreviews { public const string Short = "p";