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)
| 441 | // If repoName is non-empty, it is included in the project-scope label |
| 442 | // for additional context. |
| 443 | func ScopeLabels(repoName string) []string { |
| 444 | projectLabel := "Project: install in current repository (recommended)" |
| 445 | if repoName != "" { |
| 446 | projectLabel = fmt.Sprintf("Project: %s (recommended)", repoName) |
| 447 | } |
| 448 | return []string{ |
| 449 | projectLabel, |
| 450 | "Global: install in home directory (available everywhere)", |
| 451 | } |
| 452 | } |
| 453 | |
| 454 | // RepoNameFromRemote extracts "owner/repo" from a git remote URL. |
| 455 | func RepoNameFromRemote(remote string) string { |
no outgoing calls