mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-26 13:03:32 -06:00
[feature] Basic config validation (#562)
* add optional config validation * clarify that host and protocol are required * add validation for host and protocol * pass prerunArgs as a struct (validate by default)
This commit is contained in:
parent
6838b32235
commit
b915a41811
7 changed files with 180 additions and 15 deletions
|
|
@ -35,7 +35,7 @@ func debugCommands() *cobra.Command {
|
|||
Use: "config",
|
||||
Short: "print the collated config (derived from env, flag, and config file) to stdout",
|
||||
PreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
return preRun(cmd)
|
||||
return preRun(preRunArgs{cmd: cmd, skipValidation: true}) // don't do validation for debugging config
|
||||
},
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return run(cmd.Context(), configaction.Config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue