MCPcopy
hub / github.com/cli/cli / interactiveGitIgnore

Function interactiveGitIgnore

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

Source from the content-addressed store, hash-verified

851}
852
853func 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
872func interactiveLicense(client *http.Client, hostname string, prompter iprompter) (string, error) {
873 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