(repo repository.RepoCommon)
| 391 | } |
| 392 | |
| 393 | func promptURL(repo repository.RepoCommon) (string, string, error) { |
| 394 | validRemotes, err := getValidGithubRemoteURLs(repo) |
| 395 | if err != nil { |
| 396 | return "", "", err |
| 397 | } |
| 398 | |
| 399 | validator := func(name, value string) (string, error) { |
| 400 | _, _, err := splitURL(value) |
| 401 | if err != nil { |
| 402 | return err.Error(), nil |
| 403 | } |
| 404 | return "", nil |
| 405 | } |
| 406 | |
| 407 | url, err := input.PromptURLWithRemote("Github project URL", "URL", validRemotes, input.Required, validator) |
| 408 | if err != nil { |
| 409 | return "", "", err |
| 410 | } |
| 411 | |
| 412 | return splitURL(url) |
| 413 | } |
| 414 | |
| 415 | // splitURL extract the owner and project from a github repository URL. It will remove the |
| 416 | // '.git' extension from the URL before parsing it. |
no test coverage detected