github.com/supabase/cli@v1.168.1/internal/vanity_subdomains/delete/delete.go (about) 1 package delete 2 3 import ( 4 "context" 5 "fmt" 6 7 "github.com/go-errors/errors" 8 "github.com/spf13/afero" 9 "github.com/supabase/cli/internal/utils" 10 ) 11 12 func Run(ctx context.Context, projectRef string, fsys afero.Fs) error { 13 // 1. Sanity checks. 14 // 2. delete config 15 { 16 resp, err := utils.GetSupabase().RemoveVanitySubdomainConfigWithResponse(ctx, projectRef) 17 if err != nil { 18 return errors.Errorf("failed to delete vanity subdomain: %w", err) 19 } 20 if resp.StatusCode() != 200 { 21 return errors.New("failed to delete vanity subdomain config; received: " + string(resp.Body)) 22 } 23 fmt.Println("Deleted vanity subdomain successfully.") 24 return nil 25 } 26 }