From 89eec5c306a165467ed6cdc6e72236291a6d4493 Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Thu, 21 Sep 2023 21:46:07 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20shell=20completion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The way it was written before, the 3 commands run/shell/scan were missing their providers when they are not in active use. The problem: shell-completion relies on them to exist. Signed-off-by: Dominik Richter --- cli/providers/providers.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/cli/providers/providers.go b/cli/providers/providers.go index 8852bddfe0..3038dd194e 100644 --- a/cli/providers/providers.go +++ b/cli/providers/providers.go @@ -35,12 +35,10 @@ func AttachCLIs(rootCmd *cobra.Command, commands ...*Command) error { } connectorName, autoUpdate := detectConnectorName(os.Args, commands) - if connectorName == "" { - return nil - } - - if _, err := providers.EnsureProvider(existing, connectorName, "", autoUpdate); err != nil { - return err + if connectorName != "" { + if _, err := providers.EnsureProvider(existing, connectorName, "", autoUpdate); err != nil { + return err + } } // Now that we know we have all providers, it's time to load them to build