Fix bug migrating config, add test

This commit is contained in:
2022-04-09 12:26:56 +09:30
parent 3bbc715e74
commit 50a6ac9e85
4 changed files with 64 additions and 3 deletions

View File

@@ -224,6 +224,8 @@ func (cs *ConfigService) LoadConfig() error {
return fmt.Errorf("Could not read config '%s': %v", path, err)
}
c := Config{}
cs.Config = &c
err = yaml.Unmarshal(b, &c)
if err != nil {
return fmt.Errorf("Could not parse YAML config '%s': %v", path, err)
@@ -243,8 +245,6 @@ func (cs *ConfigService) LoadConfig() error {
cs.WriteConfig()
}
cs.Config = &c
return nil
}