From cbe5d2979cdf748e930fb9ca0e6d189aa6ecac73 Mon Sep 17 00:00:00 2001 From: Mike Mondragon Date: Tue, 27 Aug 2024 17:27:00 -0700 Subject: [PATCH] don't warn if okta.yaml doesn't exist Closes #226 --- cmd/root/web/web.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/root/web/web.go b/cmd/root/web/web.go index 841cdea..e85e4b8 100644 --- a/cmd/root/web/web.go +++ b/cmd/root/web/web.go @@ -17,6 +17,8 @@ package web import ( + "io/fs" + "github.com/spf13/cobra" "github.com/okta/okta-aws-cli/internal/config" @@ -87,7 +89,10 @@ func NewWebCommand() *cobra.Command { // Warn if there is an issue with okta.yaml _, err = config.OktaConfig() if err != nil { - webssoauth.ConsolePrint(cfg, "WARNING: issue with %s file. Run `okta-aws-cli debug` command for additional diagnosis.\nError: %+v\n", config.OktaYaml, err) + if _, pathError := err.(*fs.PathError); !pathError { + webssoauth.ConsolePrint(cfg, "WARNING: issue with %s file. Run `okta-aws-cli debug` command for additional diagnosis.\nError: %+v\n", config.OktaYaml, err) + + } } err = cliFlag.CheckRequiredFlags(requiredFlags)