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