• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 11810443631

13 Nov 2024 04:06AM UTC coverage: 59.649% (-0.09%) from 59.736%
11810443631

Pull #2875

github

sweatybridge
feat: support config push command
Pull Request #2875: feat: support config push command

5 of 29 new or added lines in 2 files covered. (17.24%)

2 existing lines in 1 file now uncovered.

6386 of 10706 relevant lines covered (59.65%)

6.06 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/internal/config/push/push.go
1
package push
2

3
import (
4
        "context"
5
        "fmt"
6
        "os"
7

8
        "github.com/spf13/afero"
9
        "github.com/supabase/cli/internal/utils"
10
        "github.com/supabase/cli/pkg/config"
11
)
12

NEW
13
func Run(ctx context.Context, ref string, fsys afero.Fs) error {
×
NEW
14
        if err := utils.LoadConfigFS(fsys); err != nil {
×
NEW
15
                return err
×
NEW
16
        }
×
NEW
17
        client := config.NewConfigUpdater(*utils.GetSupabase())
×
NEW
18
        fmt.Fprintln(os.Stderr, "Pushing config to project:", ref)
×
NEW
19
        remote, _ := utils.Config.GetRemoteByProjectRef(ref)
×
NEW
20
        console := utils.NewConsole()
×
NEW
21
        keep := func(name string) bool {
×
NEW
22
                title := fmt.Sprintf("Do you want to push %s config to remote?", name)
×
NEW
23
                shouldPush, err := console.PromptYesNo(ctx, title, true)
×
NEW
24
                if err != nil {
×
NEW
25
                        fmt.Fprintln(os.Stderr, err)
×
NEW
26
                }
×
NEW
27
                return shouldPush
×
28
        }
NEW
29
        return client.UpdateRemoteConfig(ctx, remote, keep)
×
30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc