Fixed handling of formatting errors, no rewriting

This commit is contained in:
マリウス 2022-01-17 23:19:01 -05:00
parent d525e1ad31
commit ac08eea74c
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F

View File

@ -74,6 +74,9 @@ func LoadConfig() (*Config, error) {
cfg := new(Config)
cfg.Shortcuts = make(map[string]string)
_, err = toml.Decode(string(configFileContent), &cfg)
if err != nil {
return nil, errors.New("The config could not be parsed, make sure it is valid TOML and you don't have double assignments.")
}
cfg.ConfigFile = configFile
err = cfg.LoadDefaults()