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

supabase / cli / 11831790683

14 Nov 2024 06:15AM UTC coverage: 59.627% (-0.02%) from 59.649%
11831790683

Pull #2882

github

sweatybridge
fix: use base config when no remote is declared
Pull Request #2882: fix: use base config when no remote is declared

0 of 6 new or added lines in 1 file covered. (0.0%)

6386 of 10710 relevant lines covered (59.63%)

6.05 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

13
func Run(ctx context.Context, ref string, fsys afero.Fs) error {
×
14
        if err := utils.LoadConfigFS(fsys); err != nil {
×
15
                return err
×
16
        }
×
17
        client := config.NewConfigUpdater(*utils.GetSupabase())
×
NEW
18
        remote, err := utils.Config.GetRemoteByProjectRef(ref)
×
NEW
19
        if err != nil {
×
NEW
20
                // Use base config when no remote is declared
×
NEW
21
                remote.ProjectId = ref
×
NEW
22
        }
×
NEW
23
        fmt.Fprintln(os.Stderr, "Pushing config to project:", remote.ProjectId)
×
24
        console := utils.NewConsole()
×
25
        keep := func(name string) bool {
×
26
                title := fmt.Sprintf("Do you want to push %s config to remote?", name)
×
27
                shouldPush, err := console.PromptYesNo(ctx, title, true)
×
28
                if err != nil {
×
29
                        fmt.Fprintln(os.Stderr, err)
×
30
                }
×
31
                return shouldPush
×
32
        }
33
        return client.UpdateRemoteConfig(ctx, remote, keep)
×
34
}
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