| 29 | } |
| 30 | |
| 31 | func 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 | } |