aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
Diffstat (limited to 'bridge')
-rw-r--r--bridge/gitlab/config.go30
1 files changed, 1 insertions, 29 deletions
diff --git a/bridge/gitlab/config.go b/bridge/gitlab/config.go
index 392452c6..7faddd6d 100644
--- a/bridge/gitlab/config.go
+++ b/bridge/gitlab/config.go
@@ -66,7 +66,7 @@ func (*Gitlab) Configure(repo repository.RepoCommon, params core.BridgeParams) (
if params.Token != "" {
token = params.Token
} else {
- token, err = promptTokenOptions(url)
+ token, err = promptToken()
if err != nil {
return nil, err
}
@@ -122,34 +122,6 @@ func requestToken(client *gitlab.Client, userID int, name string, scopes ...stri
return impToken.Token, nil
}
-//TODO fix this
-func promptTokenOptions(url string) (string, error) {
- for {
- fmt.Println()
- fmt.Println("[1]: user provided token")
- fmt.Println("[2]: interactive token creation")
- fmt.Print("Select option: ")
-
- line, err := bufio.NewReader(os.Stdin).ReadString('\n')
- fmt.Println()
- if err != nil {
- return "", err
- }
-
- line = strings.TrimRight(line, "\n")
-
- index, err := strconv.Atoi(line)
- if err != nil || (index != 1 && index != 2) {
- fmt.Println("invalid input")
- continue
- }
-
- if index == 1 {
- return promptToken()
- }
- }
-}
-
func promptToken() (string, error) {
fmt.Println("You can generate a new token by visiting https://gitlab.com/settings/tokens.")
fmt.Println("Choose 'Generate new token' and set the necessary access scope for your repository.")