Skip to content

Commit

Permalink
fix: Improve the experience when cancelling out
Browse files Browse the repository at this point in the history
  • Loading branch information
riweston committed Jun 21, 2022
1 parent 7f608fb commit 8d6e5d8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions cmd/aztx/contexts.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ func SelectAzureAccountsDisplayName() {
d := ReadAzureProfile(azureProfile)
currentCtx := ReadAzureProfileDefault(d)

idx, errFind := fuzzyfinder.Find(
idx, err := fuzzyfinder.Find(
d.Subscriptions,
func(i int) string {
return d.Subscriptions[i].Name
})
if errFind != nil {
panic(errFind)
},
fuzzyfinder.WithHeader(currentCtx))
if err != nil {
fmt.Printf(NoticeColor, "cancelled\n")
msg := fmt.Sprintf("%s\n", currentCtx)
fmt.Printf(InfoColor, msg)
return
}

errWrite := WriteAzureProfile(d, d.Subscriptions[idx].ID, azureProfile)
Expand Down

0 comments on commit 8d6e5d8

Please sign in to comment.