-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disable output styling for cli and tfrobot #1242
base: development
Are you sure you want to change the base?
Conversation
66382ad
to
4f0a1ac
Compare
Can you update the pr with the difference? |
fed0485
to
3801121
Compare
@@ -17,12 +17,26 @@ var getContractCmd = &cobra.Command{ | |||
Use: "contract", | |||
Short: "Get twin contract", | |||
Run: func(cmd *cobra.Command, args []string) { | |||
noColor, err := cmd.Flags().GetBool("no-color") | |||
if err != nil { | |||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would I know the error here? check other files
@@ -50,4 +64,5 @@ var getContractCmd = &cobra.Command{ | |||
|
|||
func init() { | |||
getCmd.AddCommand(getContractCmd) | |||
getContractCmd.Flags().Bool("no-color", false, "disable output styling") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not adding it to the parent command instead of adding it for every subcommand?
return fmt.Errorf("invalid log debug mode input '%v' with error: %w", debug, err) | ||
} | ||
|
||
zerolog.SetGlobalLevel(zerolog.InfoLevel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why removing this?
log.Error().Msg("deployments failed with errors: ") | ||
fmt.Println(errs) | ||
os.Exit(1) | ||
if errs := deployer.RunDeployer(context.Background(), cfg, tfPluginClient, outputPath, debug); errs != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not taking command ctx?
log.Error().Msg("failed to load configured deployments") | ||
fmt.Println(err) | ||
os.Exit(1) | ||
if err := deployer.RunLoader(context.Background(), cfg, tfPluginClient, debug, outputPath); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, why not using command ctx?
Description
add flag to disable output styling for cli and tfrobot
Related Issues
Checklist