From c6fdda1ecc41991da5fb83a80844324a7825a913 Mon Sep 17 00:00:00 2001 From: Maina Wycliffe Date: Tue, 10 Dec 2019 17:36:01 +0300 Subject: [PATCH] fix: return error/nil on login cmd run --- cmd/login.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/login.go b/cmd/login.go index d87dbf0..432e371 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -15,13 +15,14 @@ and usage of using your command. For example: Cobra is a CLI library for Go that empowers applications. This application is a tool to generate the needed files to quickly create a Cobra application.`, - Run: func(cmd *cobra.Command, args []string) { + RunE: func(cmd *cobra.Command, args []string) error { noLocalhostFlag, _ := cmd.Flags().GetBool("no-localhost") if noLocalhostFlag { - oauth.LoginWithoutLocalhost() + return oauth.LoginWithoutLocalhost() } else { oauth.LoginWithLocalhost() } + return nil }, }