Add functions to load configuration

This commit is contained in:
2021-03-14 22:11:12 -05:00
parent e86ce1aeaf
commit 32bce4eaba
2 changed files with 25 additions and 3 deletions

View File

@ -8,7 +8,6 @@ import (
"strings"
"git.kill0.net/chill9/lifx-go"
"github.com/BurntSushi/toml"
)
var userAgent string
@ -46,8 +45,7 @@ func Main(args []string) (int, error) {
return ExitFailure, err
}
if _, err := toml.DecodeFile(configPath, &config); err != nil {
err = fmt.Errorf("fatal: failed to parse %s; %w", configPath, err)
if config, err = LoadConfigFile(configPath); err != nil {
return ExitFailure, err
}