diff --git a/.gitignore b/.gitignore index 374e3f7..c081cf0 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ go.work # User-specific stuff .idea +.envrc # AWS User-specific .idea/**/aws.xml diff --git a/cmd/root.go b/cmd/root.go index 9f0195d..d0b89cd 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -40,8 +40,14 @@ Additionally, you can configure client TLS authentication by providing your cert For server TLS authentication, you can ignore the certificate by setting CDK_INSECURE=true, or provide a certificate authority using CDK_CACERT.`, PersistentPreRun: func(cmd *cobra.Command, args []string) { if *debug { - consoleApiClient().ActivateDebug() - gatewayApiClient().ActivateDebug() + // ActivateDebug() will enable debug mode for the resty client. + // Doesn't need to be set if the client was not initialised correctly. + if apiClientError == nil { + consoleApiClient().ActivateDebug() + } + if gatewayApiClientError == nil { + gatewayApiClient().ActivateDebug() + } } }, Run: func(cmd *cobra.Command, args []string) {