Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit e9553d3

Browse files
committed
Hide description if empty
Otherwise an empty pair of brackets if shown, which looks weird.
1 parent 49f23fb commit e9553d3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

internals/secrethub/service_gcp_init.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,13 @@ func (l *gcpServiceAccountOptionLister) Options() ([]ui.Option, bool, error) {
201201

202202
options := make([]ui.Option, len(resp.Accounts))
203203
for i, account := range resp.Accounts {
204+
display := account.Email
205+
if account.Description != "" {
206+
display += " (" + account.Description + ")"
207+
}
204208
options[i] = ui.Option{
205209
Value: account.Email,
206-
Display: fmt.Sprintf("%s (%s)", account.Email, account.Description),
210+
Display: display,
207211
}
208212
}
209213

0 commit comments

Comments
 (0)