mirror of
https://github.com/m1k1o/neko.git
synced 2025-05-30 01:17:13 +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
|
@ -88,8 +88,8 @@ func (c *serve) Init(cmd *cobra.Command) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// V2 configuration
|
||||
if viper.GetBool("legacy") {
|
||||
// legacy if explicitly enabled or if unspecified and legacy config is found
|
||||
if viper.GetBool("legacy") || !viper.IsSet("legacy") {
|
||||
if err := c.configs.Desktop.InitV2(cmd); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -124,7 +124,8 @@ func (c *serve) PreRun(cmd *cobra.Command, args []string) {
|
|||
c.configs.Plugins.Set()
|
||||
c.configs.Server.Set()
|
||||
|
||||
if viper.GetBool("legacy") {
|
||||
// legacy if explicitly enabled or if unspecified and legacy config is found
|
||||
if viper.GetBool("legacy") || !viper.IsSet("legacy") {
|
||||
c.configs.Desktop.SetV2()
|
||||
c.configs.Capture.SetV2()
|
||||
c.configs.WebRTC.SetV2()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue