check if err is nil before printing it

This commit is contained in:
suhussai
2017-11-03 00:28:37 -06:00
parent eeb39c5e7f
commit 9921486669

View File

@@ -18,7 +18,9 @@ func (b *BootstrapCmd) Init() *cobra.Command {
Short: "Start a guided tour of Atlantis",
RunE: func(cmd *cobra.Command, args []string) error {
err := bootstrap.Start()
fmt.Fprintf(os.Stderr, "\033[31mError: %s\033[39m\n\n", err.Error())
if err != nil {
fmt.Fprintf(os.Stderr, "\033[31mError: %s\033[39m\n\n", err.Error())
}
return err
},
}