diff --git a/internal/functions/deploy/deploy.go b/internal/functions/deploy/deploy.go index bcee53c55..408ccaa0b 100644 --- a/internal/functions/deploy/deploy.go +++ b/internal/functions/deploy/deploy.go @@ -22,6 +22,7 @@ func Run(ctx context.Context, slugs []string, useDocker bool, noVerifyJWT *bool, if err := flags.LoadConfig(fsys); err != nil { return err } else if len(slugs) > 0 { + slugs = utils.RemoveDuplicates(slugs) for _, s := range slugs { if err := utils.ValidateFunctionSlug(s); err != nil { return err @@ -67,7 +68,13 @@ func Run(ctx context.Context, slugs []string, useDocker bool, noVerifyJWT *bool, } else if err != nil { return err } - fmt.Printf("Deployed Functions on project %s: %s\n", utils.Aqua(flags.ProjectRef), strings.Join(slugs, ", ")) + deployed := make([]string, 0, len(slugs)) + for _, slug := range slugs { + if functionConfig[slug].Enabled { + deployed = append(deployed, slug) + } + } + fmt.Printf("Deployed Functions on project %s: %s\n", utils.Aqua(flags.ProjectRef), strings.Join(deployed, ", ")) url := fmt.Sprintf("%s/project/%v/functions", utils.GetSupabaseDashboardURL(), flags.ProjectRef) fmt.Println("You can inspect your deployment in the Dashboard: " + url) if !prune { @@ -92,7 +99,7 @@ func GetFunctionSlugs(fsys afero.Fs) (slugs []string, err error) { for slug := range utils.Config.Functions { slugs = append(slugs, slug) } - return slugs, nil + return utils.RemoveDuplicates(slugs), nil } func GetFunctionConfig(slugs []string, importMapPath string, noVerifyJWT *bool, fsys afero.Fs) (config.FunctionConfig, error) { @@ -110,7 +117,7 @@ func GetFunctionConfig(slugs []string, importMapPath string, noVerifyJWT *bool, for _, name := range slugs { function, ok := utils.Config.Functions[name] if !ok { - function.Enabled = true + function.Enabled = false function.VerifyJWT = true } // Precedence order: flag > config > fallback