diff --git a/internal/helper/config.go b/internal/helper/config.go index 7497c0d..8e192e2 100644 --- a/internal/helper/config.go +++ b/internal/helper/config.go @@ -5,10 +5,16 @@ import ( "github.com/charmbracelet/log" "gopkg.in/yaml.v2" "os" + "path/filepath" + "strings" ) func ParseConfig(filename string) models.ConfigFile { var config models.ConfigFile + if strings.HasPrefix(filename, "~/") { + dirname, _ := os.UserHomeDir() + filename = filepath.Join(dirname, filename[2:]) + } yamlFile, err := os.ReadFile(filename) if err != nil { log.Error("Error opening config file!", "reason", err)