MCPcopy Create free account
hub / github.com/rilldata/rill / orgExists

Function orgExists

cli/cmd/project/deploy.go:622–638  ·  view source on GitHub ↗
(ctx context.Context, ch *cmdutil.Helper, name string)

Source from the content-addressed store, hash-verified

620}
621
622func orgExists(ctx context.Context, ch *cmdutil.Helper, name string) (bool, error) {
623 c, err := ch.Client()
624 if err != nil {
625 return false, err
626 }
627
628 _, err = c.GetOrganization(ctx, &adminv1.GetOrganizationRequest{Org: name})
629 if err != nil {
630 if st, ok := status.FromError(err); ok {
631 if st.Code() == codes.NotFound {
632 return false, nil
633 }
634 }
635 return false, err
636 }
637 return true, nil
638}
639
640func getProject(ctx context.Context, ch *cmdutil.Helper, org, project string) (*adminv1.Project, bool, error) {
641 c, err := ch.Client()

Callers 1

orgNamePromptFunction · 0.85

Calls 2

GetOrganizationMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected