name, description, and visibility
(client *http.Client, hostname string, prompter iprompter, defaultName string)
| 894 | |
| 895 | // name, description, and visibility |
| 896 | func interactiveRepoInfo(client *http.Client, hostname string, prompter iprompter, defaultName string) (string, string, string, error) { |
| 897 | name, owner, err := interactiveRepoNameAndOwner(client, hostname, prompter, defaultName) |
| 898 | if err != nil { |
| 899 | return "", "", "", err |
| 900 | } |
| 901 | if owner != "" { |
| 902 | name = fmt.Sprintf("%s/%s", owner, name) |
| 903 | } |
| 904 | |
| 905 | description, err := prompter.Input("Description", "") |
| 906 | if err != nil { |
| 907 | return "", "", "", err |
| 908 | } |
| 909 | |
| 910 | visibilityOptions := getRepoVisibilityOptions(owner) |
| 911 | selected, err := prompter.Select("Visibility", "Public", visibilityOptions) |
| 912 | if err != nil { |
| 913 | return "", "", "", err |
| 914 | } |
| 915 | |
| 916 | return name, description, strings.ToUpper(visibilityOptions[selected]), nil |
| 917 | } |
| 918 | |
| 919 | func getRepoVisibilityOptions(owner string) []string { |
| 920 | visibilityOptions := []string{"Public", "Private"} |
no test coverage detected