(ctx context.Context, cmd *cli.Command)
| 133 | } |
| 134 | |
| 135 | func 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 | } |
nothing calls this directly
no test coverage detected