MCPcopy Create free account
hub / github.com/cli/cli / interactiveGitIgnore

Function interactiveGitIgnore

pkg/cmd/repo/create/create.go:852–869  ·  view source on GitHub ↗
(client *http.Client, hostname string, prompter iprompter)

Source from the content-addressed store, hash-verified

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

Callers 1

createFromScratchFunction · 0.85

Calls 3

RepoGitIgnoreTemplatesFunction · 0.92
ConfirmMethod · 0.65
SelectMethod · 0.65

Tested by

no test coverage detected