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