From c4816c25ec27f452f3338e2264626aa2fa15da68 Mon Sep 17 00:00:00 2001 From: nathan-nicholson Date: Thu, 19 Dec 2024 14:48:33 -0600 Subject: [PATCH] chore: set output for rootCmd Signed-off-by: nathan-nicholson --- cmd/root.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index f910a64c..1fc1daff 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -44,7 +44,8 @@ func Execute() { SilenceErrors: true, } - printer := os.Stderr + rootCmd.SetErr(os.Stderr) + rootCmd.SetOut(os.Stdout) rootCmd.AddCommand( betaCmd, @@ -67,9 +68,9 @@ func Execute() { common.CheckForVersionUpdate() progressPrinter.GetInstance() if err := rootCmd.Execute(); err != nil { - fmt.Fprintf(printer, "Error occurred during command execution: %v\n", err) - fmt.Fprintln(printer, "If a detailed error message was available, please make the necessary corrections before retrying.") - fmt.Fprintln(printer, "You can re-run the last command to try the operation again.") + fmt.Printf("Error occurred during command execution: %v\n", err) + fmt.Println("If a detailed error message was available, please make the necessary corrections before retrying.") + fmt.Println("You can re-run the last command to try the operation again.") os.Exit(1) } }