mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-30 15:00:26 +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
|
@ -110,6 +110,8 @@ func (s *Desktop) Set() {
|
|||
}
|
||||
|
||||
func (s *Desktop) SetV2() {
|
||||
enableLegacy := false
|
||||
|
||||
if viper.IsSet("screen") {
|
||||
r := regexp.MustCompile(`([0-9]{1,4})x([0-9]{1,4})@([0-9]{1,3})`)
|
||||
res := r.FindStringSubmatch(viper.GetString("screen"))
|
||||
|
@ -126,5 +128,12 @@ func (s *Desktop) SetV2() {
|
|||
}
|
||||
}
|
||||
log.Warn().Msg("you are using v2 configuration 'NEKO_SCREEN' which is deprecated, please use 'NEKO_DESKTOP_SCREEN' instead")
|
||||
enableLegacy = true
|
||||
}
|
||||
|
||||
// set legacy flag if any V2 configuration was used
|
||||
if !viper.IsSet("legacy") && enableLegacy {
|
||||
log.Warn().Msg("legacy configuration is enabled because at least one V2 configuration was used, please migrate to V3 configuration, or set 'NEKO_LEGACY=true' to acknowledge this message")
|
||||
viper.Set("legacy", true)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue