Skip to content

Commit

Permalink
fix: disable interactive console when seeding on start (#2483)
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge authored Jul 2, 2024
1 parent 3f2333c commit 0a1061d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
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

0 comments on commit 0a1061d

Please sign in to comment.