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

Function commandVersion

cli/cmd/software/version.go:135–161  ·  view source on GitHub ↗
(ctx context.Context, cmd *cli.Command)

Source from the content-addressed store, hash-verified

133}
134
135func commandVersion(ctx context.Context, cmd *cli.Command) error {
136 ce := clienv.FromCLI(cmd)
137
138 var (
139 cfg *model.ConfigConfig
140 err error
141 )
142
143 if clienv.PathExists(ce.Path.NhostToml()) && clienv.PathExists(ce.Path.Secrets()) {
144 var secrets model.Secrets
145 if err := clienv.UnmarshalFile(ce.Path.Secrets(), &secrets, env.Unmarshal); err != nil {
146 return fmt.Errorf(
147 "failed to parse secrets, make sure secret values are between quotes: %w",
148 err,
149 )
150 }
151
152 cfg, err = config.Validate(ce, "local", secrets)
153 if err != nil {
154 return fmt.Errorf("failed to validate config: %w", err)
155 }
156 } else {
157 ce.Warnln("🟡 No Nhost project found")
158 }
159
160 return CheckVersions(ctx, ce, cfg, cmd.Root().Version)
161}

Callers

nothing calls this directly

Calls 10

FromCLIFunction · 0.92
PathExistsFunction · 0.92
UnmarshalFileFunction · 0.92
ValidateFunction · 0.92
CheckVersionsFunction · 0.85
NhostTomlMethod · 0.80
SecretsMethod · 0.80
ErrorfMethod · 0.80
WarnlnMethod · 0.80
RootMethod · 0.80

Tested by

no test coverage detected