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)
| 408 | // If repoName is non-empty, it is included in the project-scope label |
| 409 | // for additional context. |
| 410 | func ScopeLabels(repoName string) []string { |
| 411 | projectLabel := "Project: install in current repository (recommended)" |
| 412 | if repoName != "" { |
| 413 | projectLabel = fmt.Sprintf("Project: %s (recommended)", repoName) |
| 414 | } |
| 415 | return []string{ |
| 416 | projectLabel, |
| 417 | "Global: install in home directory (available everywhere)", |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | // RepoNameFromRemote extracts "owner/repo" from a git remote URL. |
| 422 | func RepoNameFromRemote(remote string) string { |
no outgoing calls