MCPcopy Create free account
hub / github.com/nhost/nhost / commandApply

Function commandApply

cli/cmd/config/apply.go:36–61  ·  view source on GitHub ↗
(ctx context.Context, cmd *cli.Command)

Source from the content-addressed store, hash-verified

34}
35
36func commandApply(ctx context.Context, cmd *cli.Command) error {
37 ce := clienv.FromCLI(cmd)
38
39 proj, err := ce.GetAppInfo(ctx, cmd.String(flagSubdomain))
40 if err != nil {
41 return cli.Exit(fmt.Sprintf("Failed to get app info: %v", err), 1)
42 }
43
44 ce.Infoln("Validating configuration...")
45
46 cfg, _, err := ValidateRemote(
47 ctx,
48 ce,
49 proj.GetSubdomain(),
50 proj.GetID(),
51 )
52 if err != nil {
53 return cli.Exit(err.Error(), 1)
54 }
55
56 if err := Apply(ctx, ce, proj.ID, cfg, cmd.Bool(flagYes)); err != nil {
57 return cli.Exit(err.Error(), 1)
58 }
59
60 return nil
61}
62
63func Apply(
64 ctx context.Context,

Callers

nothing calls this directly

Calls 9

FromCLIFunction · 0.92
ValidateRemoteFunction · 0.85
ApplyFunction · 0.85
GetAppInfoMethod · 0.80
InfolnMethod · 0.80
GetSubdomainMethod · 0.80
StringMethod · 0.45
GetIDMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected