Change prompts for gh auth login to reflect change from GHE to Other

This commit is contained in:
Tyler McGoffin 2024-09-20 14:10:05 -07:00
parent bc587f6576
commit 13e916bcfb
3 changed files with 5 additions and 5 deletions

View file

@ -92,7 +92,7 @@ func (p *surveyPrompter) InputHostname() (string, error) {
var result string
err := p.ask(
&survey.Input{
Message: "GHE hostname:",
Message: "Hostname:",
}, &result, survey.WithValidator(func(v interface{}) error {
return ghinstance.HostnameValidator(v.(string))
}))

View file

@ -228,7 +228,7 @@ func loginRun(opts *LoginOptions) error {
func promptForHostname(opts *LoginOptions) (string, error) {
options := []string{"GitHub.com", "Other"}
hostType, err := opts.Prompter.Select(
"What account do you want to log into?",
"Where do you use GitHub?",
options[0],
options)
if err != nil {

View file

@ -564,7 +564,7 @@ func Test_loginRun_Survey(t *testing.T) {
prompterStubs: func(pm *prompter.PrompterMock) {
pm.SelectFunc = func(prompt, _ string, opts []string) (int, error) {
switch prompt {
case "What account do you want to log into?":
case "Where do you use GitHub?":
return prompter.IndexFor(opts, "Other")
case "What is your preferred protocol for Git operations on this host?":
return prompter.IndexFor(opts, "HTTPS")
@ -607,7 +607,7 @@ func Test_loginRun_Survey(t *testing.T) {
prompterStubs: func(pm *prompter.PrompterMock) {
pm.SelectFunc = func(prompt, _ string, opts []string) (int, error) {
switch prompt {
case "What account do you want to log into?":
case "Where do you use GitHub?":
return prompter.IndexFor(opts, "GitHub.com")
case "What is your preferred protocol for Git operations on this host?":
return prompter.IndexFor(opts, "HTTPS")
@ -641,7 +641,7 @@ func Test_loginRun_Survey(t *testing.T) {
prompterStubs: func(pm *prompter.PrompterMock) {
pm.SelectFunc = func(prompt, _ string, opts []string) (int, error) {
switch prompt {
case "What account do you want to log into?":
case "Where do you use GitHub?":
return prompter.IndexFor(opts, "GitHub.com")
case "What is your preferred protocol for Git operations on this host?":
return prompter.IndexFor(opts, "SSH")