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