Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable interactive console when seeding on start #2483

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (
Short: "Seed buckets declared in [storage.buckets]",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
return buckets.Run(cmd.Context())
return buckets.Run(cmd.Context(), utils.NewConsole())
},
}
)
Expand Down
3 changes: 1 addition & 2 deletions internal/seed/buckets/buckets.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/supabase/cli/pkg/storage"
)

func Run(ctx context.Context) error {
func Run(ctx context.Context, console *utils.Console) error {
api, err := client.NewStorageAPI(ctx, flags.ProjectRef)
if err != nil {
return err
Expand All @@ -21,7 +21,6 @@ func Run(ctx context.Context) error {
return err
}
var exists []string
console := utils.NewConsole()
for _, b := range buckets {
props := NewBucketProps(b.Name)
if props == nil {
Expand Down
5 changes: 4 additions & 1 deletion internal/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,10 @@ EOF
if err := start.WaitForHealthyService(ctx, serviceTimeout, utils.StorageId); err != nil {
return err
}
if err := buckets.Run(ctx); err != nil {
// Disable prompts when seeding
console := utils.NewConsole()
console.IsTTY = false
if err := buckets.Run(ctx, console); err != nil {
return err
}
}
Expand Down