(ctx context.Context, cmd *cli.Command)
| 34 | } |
| 35 | |
| 36 | func commandValidate(ctx context.Context, cmd *cli.Command) error { |
| 37 | ce := clienv.FromCLI(cmd) |
| 38 | |
| 39 | subdomain := cmd.String(flagSubdomain) |
| 40 | if subdomain != "" && subdomain != "local" { |
| 41 | proj, err := ce.GetAppInfo(ctx, cmd.String(flagSubdomain)) |
| 42 | if err != nil { |
| 43 | return fmt.Errorf("failed to get app info: %w", err) |
| 44 | } |
| 45 | |
| 46 | _, _, err = ValidateRemote( |
| 47 | ctx, |
| 48 | ce, |
| 49 | proj.GetSubdomain(), |
| 50 | proj.GetID(), |
| 51 | ) |
| 52 | |
| 53 | return err |
| 54 | } |
| 55 | |
| 56 | var secrets model.Secrets |
| 57 | if err := clienv.UnmarshalFile(ce.Path.Secrets(), &secrets, env.Unmarshal); err != nil { |
| 58 | return fmt.Errorf( |
| 59 | "failed to parse secrets, make sure secret values are between quotes: %w", |
| 60 | err, |
| 61 | ) |
| 62 | } |
| 63 | |
| 64 | ce.Infoln("Verifying configuration...") |
| 65 | |
| 66 | if _, err := Validate(ce, "local", secrets); err != nil { |
| 67 | return err |
| 68 | } |
| 69 | |
| 70 | ce.Infoln("Configuration is valid!") |
| 71 | |
| 72 | return nil |
| 73 | } |
| 74 | |
| 75 | func ApplyJSONPatches[T any]( |
| 76 | cfg T, |
nothing calls this directly
no test coverage detected