Skip to content

Commit

Permalink
add early exit
Browse files Browse the repository at this point in the history
Signed-off-by: bryans-go <[email protected]>
  • Loading branch information
bryans-go committed Sep 27, 2024
1 parent 58d6c16 commit 0660fde
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pkg/views/gitprovider/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,20 @@ func getSigningKeyDescription(signingMethod string) string {
}

func getGitProviderHelpMessage(gitProviderId string) string {
docsLink := config.GetDocsLinkFromGitProvider(gitProviderId)
requiredScopes := config.GetRequiredScopesFromGitProviderId(gitProviderId)
prebuildScopes := config.GetPrebuildScopesFromGitProviderId(gitProviderId)

if docsLink == "" || requiredScopes == "" {
return ""
}

message := fmt.Sprintf("%s\n%s\n\n%s%s",
lipgloss.NewStyle().Foreground(views.Green).Bold(true).Render("More information on:"),
config.GetDocsLinkFromGitProvider(gitProviderId),
docsLink,
lipgloss.NewStyle().Foreground(views.Green).Bold(true).Render("Required scopes: "),
config.GetRequiredScopesFromGitProviderId(gitProviderId))
requiredScopes)

prebuildScopes := config.GetPrebuildScopesFromGitProviderId(gitProviderId)
if prebuildScopes != "" {
message = fmt.Sprintf("%s\n%s%s",
message,
Expand Down

0 comments on commit 0660fde

Please sign in to comment.