From a82aa225a82de4c1fb9ee94248fbded044a92a6d Mon Sep 17 00:00:00 2001 From: Joe Naegele Date: Tue, 28 May 2024 08:46:44 -0400 Subject: [PATCH] Fix #150 (#157) --- tooling/internal/cmd/generatecommand.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tooling/internal/cmd/generatecommand.go b/tooling/internal/cmd/generatecommand.go index d4b88089..713401b6 100644 --- a/tooling/internal/cmd/generatecommand.go +++ b/tooling/internal/cmd/generatecommand.go @@ -43,7 +43,7 @@ func newGenerateCommand() *cobra.Command { if err != nil { // avoiding returning the error here because // cobra prefixes the error with "Error: " - fmt.Fprintln(os.Stderr, err) + log.Error().Msg(err.Error()) os.Exit(1) } @@ -139,11 +139,10 @@ func generateInWatchMode() []string { screen.Clear() screen.MoveTopLeft() - fmt.Printf("Validated model package '%s' at %v.\n\n", packageInfo.Namespace, time.Now().Format("15:04:05")) - if err != nil { - fmt.Println(err) + log.Error().Msg(err.Error()) } else { + fmt.Printf("Validated model package '%s' at %v.\n\n", packageInfo.Namespace, time.Now().Format("15:04:05")) for _, warning := range warnings { log.Warn().Msg(warning) }