mirror of
https://gitea.com/gitea/tea.git
synced 2024-11-24 11:31:36 +01:00
d0e05e8be2
move password prompt to interact module closes #231 allow up to 3 ssh key password attempts rename param Co-authored-by: Norwin Roosen <git@nroo.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/276 Reviewed-by: 6543 <6543@obermui.de> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-Authored-By: Norwin <noerw@noreply.gitea.io> Co-Committed-By: Norwin <noerw@noreply.gitea.io>
17 lines
507 B
Go
17 lines
507 B
Go
// Copyright 2020 The Gitea Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package interact
|
|
|
|
import (
|
|
"github.com/AlecAivazis/survey/v2"
|
|
)
|
|
|
|
// PromptPassword asks for a password and blocks until input was made.
|
|
func PromptPassword(name string) (pass string, err error) {
|
|
promptPW := &survey.Password{Message: name + " password:"}
|
|
err = survey.AskOne(promptPW, &pass, survey.WithValidator(survey.Required))
|
|
return
|
|
}
|