mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-14 16:52:47 +02:00
enable legacy supprot if at least one legacy config entry is found.
This commit is contained in:
parent
3ac462e197
commit
4eadf996ed
12 changed files with 152 additions and 8 deletions
|
@ -81,6 +81,11 @@ func init() {
|
|||
// set root config values
|
||||
rootConfig.Set()
|
||||
|
||||
// legacy if explicitly enabled or if unspecified and legacy config is found
|
||||
if viper.GetBool("legacy") || !viper.IsSet("legacy") {
|
||||
rootConfig.SetV2()
|
||||
}
|
||||
|
||||
//////
|
||||
// logs
|
||||
//////
|
||||
|
@ -161,5 +166,12 @@ func init() {
|
|||
log.Panic().Err(err).Msg("unable to run root command")
|
||||
}
|
||||
|
||||
// legacy if explicitly enabled or if unspecified and legacy config is found
|
||||
if viper.GetBool("legacy") || !viper.IsSet("legacy") {
|
||||
if err := rootConfig.InitV2(root); err != nil {
|
||||
log.Panic().Err(err).Msg("unable to run root command")
|
||||
}
|
||||
}
|
||||
|
||||
root.SetVersionTemplate(neko.Version.Details())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue