Skip to content

Commit

Permalink
Do not prompt when single name in layer
Browse files Browse the repository at this point in the history
  • Loading branch information
silphid committed Jun 24, 2021
1 parent be7c6bd commit 931f811
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cmd/prompts.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ func GetOrPromptContextNames(contexts yey.Contexts, names []string) ([]string, e

// Prompt unspecified names
for i := len(names); i < len(contexts.Layers); i++ {
// Don't prompt when single name in layer
if len(availableNames[i]) == 1 {
names = append(names, availableNames[i][0])
continue
}
prompt := &survey.Select{
Message: fmt.Sprintf("Select %s:", contexts.Layers[i].Name),
Options: availableNames[i],
Expand Down

0 comments on commit 931f811

Please sign in to comment.