(client *http.Client, hostname string, prompter iprompter)
| 851 | } |
| 852 | |
| 853 | func interactiveGitIgnore(client *http.Client, hostname string, prompter iprompter) (string, error) { |
| 854 | confirmed, err := prompter.Confirm("Would you like to add a .gitignore?", false) |
| 855 | if err != nil { |
| 856 | return "", err |
| 857 | } else if !confirmed { |
| 858 | return "", nil |
| 859 | } |
| 860 | |
| 861 | templates, err := api.RepoGitIgnoreTemplates(client, hostname) |
| 862 | if err != nil { |
| 863 | return "", err |
| 864 | } |
| 865 | selected, err := prompter.Select("Choose a .gitignore template", "", templates) |
| 866 | if err != nil { |
| 867 | return "", err |
| 868 | } |
| 869 | return templates[selected], nil |
| 870 | } |
| 871 | |
| 872 | func interactiveLicense(client *http.Client, hostname string, prompter iprompter) (string, error) { |
| 873 | confirmed, err := prompter.Confirm("Would you like to add a license?", false) |
no test coverage detected