Skip to content

Commit

Permalink
Fix verbose mode in single client configuration (#93)
Browse files Browse the repository at this point in the history
* chore: gitignore updated

* fix: verbose mode fixed when missing client initialisation
  • Loading branch information
marnas authored Feb 11, 2025
1 parent 08ab731 commit d6d3d41
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ go.work

# User-specific stuff
.idea
.envrc

# AWS User-specific
.idea/**/aws.xml
Expand Down
10 changes: 8 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit d6d3d41

Please sign in to comment.