Skip to content

Commit 2fe4a96

Browse files
committed
Change error message not to autolist user's groups
1 parent 7aa9c82 commit 2fe4a96

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

internal/cmd/db_create.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,18 +146,14 @@ func groupFromFlag(groups []turso.Group) (turso.Group, error) {
146146

147147
if groupFlag != "" {
148148
if !groupExists(groups, groupFlag) {
149-
groupNames := make([]string, len(groups))
150-
for i, g := range groups {
151-
groupNames[i] = g.Name
152-
}
153-
return turso.Group{}, fmt.Errorf("group %s does not exist. You have the following groups: %v. You can use 'turso group create' to create a new group", groupFlag, strings.Join(groupNames, ", "))
149+
return turso.Group{}, fmt.Errorf("group %s does not exist. Please double-check the name. You can run 'turso group list' to get a list of your groups, or 'turso group create' to make a new one", groupFlag)
154150
}
155151
for _, group := range groups {
156152
if group.Name == groupFlag {
157153
return group, nil
158154
}
159155
}
160-
return turso.Group{}, fmt.Errorf("group %s does not exist", groupFlag)
156+
return turso.Group{}, fmt.Errorf("group %s does not exist. Please double-check the name. You can run 'turso group list' to get a list of your groups, or 'turso group create' to make a new one", groupFlag)
161157
}
162158

163159
switch {

0 commit comments

Comments
 (0)