From 87b97ca4b2f39240c698596ac14a6d3532f6363d Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 15 Feb 2020 13:45:14 +0100 Subject: bridges: more refactor and cleanup --- bridge/gitlab/config.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bridge/gitlab/config.go') diff --git a/bridge/gitlab/config.go b/bridge/gitlab/config.go index 94026635..b730a365 100644 --- a/bridge/gitlab/config.go +++ b/bridge/gitlab/config.go @@ -161,14 +161,18 @@ func promptTokenOptions(repo repository.RepoConfig, login, baseUrl string) (auth return nil, err } - cred, err := input.PromptCredential(target, "token", creds) - switch err { - case nil: + cred, index, err := input.PromptCredential(target, "token", creds, []string{ + "enter my token", + }) + switch { + case err != nil: + return nil, err + case cred != nil: return cred, nil - case input.ErrDirectPrompt: + case index == 0: return promptToken(baseUrl) default: - return nil, err + panic("missed case") } } -- cgit