diff --git a/config/config.go b/config/config.go index 606cf82..e6c3ecb 100644 --- a/config/config.go +++ b/config/config.go @@ -449,8 +449,6 @@ func (config *MixConfig) Convert(filename string) error { return err } - // Force UseNewConfig to false - UseNewConfig = false if err := config.Parse(); err != nil { return err } @@ -459,9 +457,12 @@ func (config *MixConfig) Convert(filename string) error { return err } - // Force UseNewConfig to true + // Make sure the converted config is in the New Format UseNewConfig = true + // Set config to the current format + config.version = CurrentConfigVersion + return config.SaveConfig() } diff --git a/mixer/cmd/config.go b/mixer/cmd/config.go index 7d02453..43527a0 100644 --- a/mixer/cmd/config.go +++ b/mixer/cmd/config.go @@ -51,6 +51,13 @@ var configConvertCmd = &cobra.Command{ a backup file of the old config and will replace it with the converted one. Environment variables will not be expanded and the values will not be validated`, Run: func(cmd *cobra.Command, args []string) { + /* If no state file exists, it must be created first to ensure the FORMAT value + is transferred from old configs before conversion */ + var ms config.MixState + if err := ms.Load(); err != nil { + fail(err) + } + var mc config.MixConfig if err := mc.Convert(configFile); err != nil { fail(err)