chore: do not auto migrate on manual switch

This commit is contained in:
Jan De Dobbeleer 2022-02-02 13:40:58 +01:00 committed by Jan De Dobbeleer
parent 6fcae4207e
commit bfca351796

View file

@ -75,7 +75,8 @@ func (cfg *Config) exitWithError(err error) {
// LoadConfig returns the default configuration including possible user overrides
func LoadConfig(env environment.Environment) *Config {
cfg := loadConfig(env)
if cfg.Version != configVersion {
// only migrate automatically when the switch isn't set
if !*env.Args().Migrate && cfg.Version != configVersion {
cfg.Backup()
cfg.Migrate(env)
cfg.Write()