From 5aa2dc40cd8b922cccdb2d1731848e4f28fe1f9e Mon Sep 17 00:00:00 2001 From: Rita Zerrizuela Date: Wed, 12 May 2021 16:38:39 -0300 Subject: [PATCH] Move configs to the top of the pre-run method (#283) --- internal/cli/root.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/cli/root.go b/internal/cli/root.go index c98424a40..c70045fe1 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -31,8 +31,10 @@ func Execute() { Short: "Supercharge your development workflow.", Long: "Supercharge your development workflow.\n" + getLogin(cli), Version: buildinfo.GetVersionWithCommit(), - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { + ansi.DisableColors = cli.noColor + prepareInteractivity(cmd) + // If the user is trying to login, no need to go // through setup. if cmd.Use == "login" && cmd.Parent().Use == "auth0" { @@ -60,10 +62,6 @@ func Execute() { return nil } - ansi.DisableColors = cli.noColor - - prepareInteractivity(cmd) - // Initialize everything once. Later callers can then // freely assume that config is fully primed and ready // to go.