diff options
author | Igor <idrozdov@gitlab.com> | 2019-10-23 08:19:23 +0000 |
---|---|---|
committer | Igor <idrozdov@gitlab.com> | 2019-10-23 08:19:23 +0000 |
commit | 7d36bc3bba67d42f7d23bd16624ef5e6aab2bddc (patch) | |
tree | b768c10328ca69591ca1613e18a38131b950ae08 /internal/command/receivepack/customaction.go | |
parent | 629e3bf9c31687f7b824cf29ba07ad2ce402e280 (diff) | |
parent | aa82832f7ba0a6ca7017f019be17810579f9a688 (diff) | |
download | gitlab-shell-7d36bc3bba67d42f7d23bd16624ef5e6aab2bddc.tar.gz |
Merge branch 'ashmckenzie/make-console-messages-consistent' into 'master'
Make console messages consistent
See merge request gitlab-org/gitlab-shell!334
Diffstat (limited to 'internal/command/receivepack/customaction.go')
-rw-r--r-- | internal/command/receivepack/customaction.go | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/internal/command/receivepack/customaction.go b/internal/command/receivepack/customaction.go index c94ae4c..7575ee9 100644 --- a/internal/command/receivepack/customaction.go +++ b/internal/command/receivepack/customaction.go @@ -3,12 +3,13 @@ package receivepack import ( "bytes" "errors" - "fmt" + "io" "io/ioutil" "net/http" "strings" + "gitlab.com/gitlab-org/gitlab-shell/internal/console" "gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet" "gitlab.com/gitlab-org/gitlab-shell/internal/gitlabnet/accessverifier" ) @@ -32,19 +33,11 @@ func (c *Command) processCustomAction(response *accessverifier.Response) error { return errors.New("Custom action error: Empty API endpoints") } - c.displayInfoMessage(data.InfoMessage) + console.DisplayInfoMessages(strings.Split(data.InfoMessage, "\n"), c.ReadWriter.ErrOut) return c.processApiEndpoints(response) } -func (c *Command) displayInfoMessage(infoMessage string) { - messages := strings.Split(infoMessage, "\n") - - for _, msg := range messages { - fmt.Fprintf(c.ReadWriter.ErrOut, "> GitLab: %v\n", msg) - } -} - func (c *Command) processApiEndpoints(response *accessverifier.Response) error { client, err := gitlabnet.GetClient(c.Config) |