configs to root.

This commit is contained in:
Miroslav Šedivý 2022-01-14 00:22:23 +01:00
parent 62353c776d
commit 66d22dede4
3 changed files with 20 additions and 53 deletions

View file

@ -33,14 +33,7 @@ func init() {
Run: service.ServeCommand,
}
cobra.OnInitialize(func() {
service.Configs.Set()
service.Preflight()
})
if err := service.Configs.Init(command); err != nil {
log.Panic().Err(err).Msg("unable to run serve command")
}
cobra.OnInitialize(service.Preflight)
root.AddCommand(command)
}