ScopeLabels returns the display labels for the scope selection prompt. If repoName is non-empty, it is included in the project-scope label for additional context.
(repoName string)
| 447 | // If repoName is non-empty, it is included in the project-scope label |
| 448 | // for additional context. |
| 449 | func ScopeLabels(repoName string) []string { |
| 450 | projectLabel := "Project: install in current repository (recommended)" |
| 451 | if repoName != "" { |
| 452 | projectLabel = fmt.Sprintf("Project: %s (recommended)", repoName) |
| 453 | } |
| 454 | return []string{ |
| 455 | projectLabel, |
| 456 | "Global: install in home directory (available everywhere)", |
| 457 | } |
| 458 | } |
| 459 | |
| 460 | // RepoNameFromRemote extracts "owner/repo" from a git remote URL. |
| 461 | func RepoNameFromRemote(remote string) string { |
no outgoing calls