From 528b71bef73be366d418e703701052f1790b8db9 Mon Sep 17 00:00:00 2001 From: Radoslav Dimitrov Date: Thu, 16 Nov 2023 14:12:48 +0200 Subject: [PATCH] Do not fail if profile exists Signed-off-by: Radoslav Dimitrov --- cmd/cli/app/quickstart/quickstart.go | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/cmd/cli/app/quickstart/quickstart.go b/cmd/cli/app/quickstart/quickstart.go index 10ca8994fc..eaada58791 100644 --- a/cmd/cli/app/quickstart/quickstart.go +++ b/cmd/cli/app/quickstart/quickstart.go @@ -283,25 +283,20 @@ var cmd = &cobra.Command{ if st.Code() != codes.AlreadyExists { return fmt.Errorf("error creating profile: %w", err) } - cmd.Println("Profile already exists") - return nil + cmd.Println("Hey, it seems you already tried the quickstart command and created such a profile. " + + "In case you have registered new repositories this time, the profile will be already applied " + + "to them.") + } else { + return fmt.Errorf("error creating profile: %w", err) } - return fmt.Errorf("error creating profile: %w", err) + } else { + table := profile.InitializeTable(cmd) + profile.RenderProfileTable(resp.GetProfile(), table) + table.Render() } - table := profile.InitializeTable(cmd) - profile.RenderProfileTable(resp.GetProfile(), table) - table.Render() - // Finish - Confirm profile creation - yes = cli.PrintYesNoPrompt(cmd, - stepPromptMsgFinish, - "Finish?", - "Quickstart operation completed.") - if !yes { - return nil - } - + cli.PrintCmd(cmd, cli.WarningBanner.Render(stepPromptMsgFinish)) return nil }, }