From 9c313526e7edd5f6fbe81d037e19f32d71f13e4f Mon Sep 17 00:00:00 2001 From: Matthias Langhard Date: Thu, 4 Nov 2021 08:22:09 +0100 Subject: [PATCH] feat: implements option to add a service-name when initializing first tag --- src/Cli/AppRunner.cs | 9 +++++++++ src/Core/Models/Version.cs | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Cli/AppRunner.cs b/src/Cli/AppRunner.cs index de8845f..a342b64 100644 --- a/src/Cli/AppRunner.cs +++ b/src/Cli/AppRunner.cs @@ -103,6 +103,15 @@ namespace Cli new Selection("no", null) ) ); + var serviceName = AnsiConsole.Prompt( + new TextPrompt("[grey][[Optional]][/] Enter [green]service name[/]:") + .AllowEmpty() + ); + + if (!string.IsNullOrWhiteSpace(serviceName)) + { + selection.Version.SetService(serviceName.Trim()); + } } if (selection.Version == null) diff --git a/src/Core/Models/Version.cs b/src/Core/Models/Version.cs index a1be776..00da579 100644 --- a/src/Core/Models/Version.cs +++ b/src/Core/Models/Version.cs @@ -57,7 +57,7 @@ namespace Application.Models public int Minor { get; private set; } public int Patch { get; private set; } public int? Rc { get; private set; } - public string Service { get; } + public string Service { get; private set; } public override string ToString() @@ -198,5 +198,10 @@ namespace Application.Models { return Rc != null; } + + public void SetService(string service) + { + Service = service; + } } } \ No newline at end of file