Skip to content

Commit

Permalink
Merge pull request #107 from auth0/cli-35-tenant-name
Browse files Browse the repository at this point in the history
CLI-35: include tenant name, if it is set, when rendering command failures.
  • Loading branch information
rene00 authored Feb 23, 2021
2 parents e318ece + ccf8643 commit f32f8e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"os"

"github.com/auth0/auth0-cli/internal/ansi"
"github.com/auth0/auth0-cli/internal/display"
"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -74,6 +75,11 @@ func Execute() {
// rootCmd.AddCommand(triggersCmd(cli))

if err := rootCmd.ExecuteContext(context.TODO()); err != nil {
header := []string{"error\n"}
if cli.tenant != "" {
header = append([]string{ansi.Bold(cli.tenant)}, header...)
}
cli.renderer.Heading(header...)
cli.renderer.Errorf(err.Error())
os.Exit(1)
}
Expand Down

0 comments on commit f32f8e6

Please sign in to comment.