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

Function commandShow

cli/cmd/config/show.go:31–55  ·  view source on GitHub ↗
(_ context.Context, cmd *cli.Command)

Source from the content-addressed store, hash-verified

29}
30
31func commandShow(_ context.Context, cmd *cli.Command) error {
32 ce := clienv.FromCLI(cmd)
33
34 var secrets model.Secrets
35 if err := clienv.UnmarshalFile(ce.Path.Secrets(), &secrets, env.Unmarshal); err != nil {
36 return fmt.Errorf(
37 "failed to parse secrets, make sure secret values are between quotes: %w",
38 err,
39 )
40 }
41
42 cfg, err := Validate(ce, cmd.String(flagSubdomain), secrets)
43 if err != nil {
44 return err
45 }
46
47 b, err := toml.Marshal(cfg)
48 if err != nil {
49 return fmt.Errorf("error marshalling config: %w", err)
50 }
51
52 ce.Println("%s", b)
53
54 return nil
55}

Callers

nothing calls this directly

Calls 7

FromCLIFunction · 0.92
UnmarshalFileFunction · 0.92
SecretsMethod · 0.80
ErrorfMethod · 0.80
PrintlnMethod · 0.80
ValidateFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected