From 64e2fc9c78dd84908116ef5bec6b0aa42eed1ee1 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Thu, 14 Nov 2024 14:15:51 +0800 Subject: [PATCH] fix: use base config when no remote is declared --- internal/config/push/push.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/config/push/push.go b/internal/config/push/push.go index 0a8c88c4e..a4c901473 100644 --- a/internal/config/push/push.go +++ b/internal/config/push/push.go @@ -15,8 +15,12 @@ func Run(ctx context.Context, ref string, fsys afero.Fs) error { return err } client := config.NewConfigUpdater(*utils.GetSupabase()) - fmt.Fprintln(os.Stderr, "Pushing config to project:", ref) - remote, _ := utils.Config.GetRemoteByProjectRef(ref) + remote, err := utils.Config.GetRemoteByProjectRef(ref) + if err != nil { + // Use base config when no remote is declared + remote.ProjectId = ref + } + fmt.Fprintln(os.Stderr, "Pushing config to project:", remote.ProjectId) console := utils.NewConsole() keep := func(name string) bool { title := fmt.Sprintf("Do you want to push %s config to remote?", name)